mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-28 11:01:30 +08:00
Merge pull request #948 from ArthurSmoke/master
fix - get response data with jmespath when variable in validate field
This commit is contained in:
@@ -189,12 +189,12 @@ class ResponseObject(object):
|
|||||||
check_item = u_validator["check"]
|
check_item = u_validator["check"]
|
||||||
if "$" in check_item:
|
if "$" in check_item:
|
||||||
# check_item is variable or function
|
# check_item is variable or function
|
||||||
check_value = parse_data(
|
check_item = parse_data(
|
||||||
check_item, variables_mapping, functions_mapping
|
check_item, variables_mapping, functions_mapping
|
||||||
)
|
)
|
||||||
check_value = parse_string_value(check_value)
|
check_item = parse_string_value(check_item)
|
||||||
else:
|
|
||||||
check_value = jmespath.search(check_item, self.resp_obj_meta)
|
check_value = jmespath.search(check_item, self.resp_obj_meta)
|
||||||
|
|
||||||
# comparator
|
# comparator
|
||||||
assert_method = u_validator["assert"]
|
assert_method = u_validator["assert"]
|
||||||
|
|||||||
Reference in New Issue
Block a user