fix: check if jmespath extractor valid

This commit is contained in:
debugtalk
2020-06-14 22:47:48 +08:00
parent fb81622fca
commit 9ef795b5fb

View File

@@ -47,6 +47,9 @@ def convert_variables(
def convert_jmespath(raw: Text) -> Text:
if not isinstance(raw, Text):
raise exceptions.TestCaseFormatError(f"Invalid jmespath extractor: {raw}")
# content.xx/json.xx => body.xx
if raw.startswith("content"):
raw = f"body{raw[len('content'):]}"