mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 00:39:34 +08:00
fix: check if jmespath extractor valid
This commit is contained in:
@@ -47,6 +47,9 @@ def convert_variables(
|
|||||||
|
|
||||||
|
|
||||||
def convert_jmespath(raw: Text) -> Text:
|
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
|
# content.xx/json.xx => body.xx
|
||||||
if raw.startswith("content"):
|
if raw.startswith("content"):
|
||||||
raw = f"body{raw[len('content'):]}"
|
raw = f"body{raw[len('content'):]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user