mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-05 15:59:33 +08:00
validate response: check validators and variables_mapping
This commit is contained in:
@@ -89,13 +89,14 @@ class ResponseObject(object):
|
||||
try:
|
||||
value = variables_mapping[validator_key]
|
||||
validator_dict["value"] = value
|
||||
expected_value = validator_dict["expected"]
|
||||
except KeyError:
|
||||
raise exception.ParamsError("invalid validator %s" % validator_key)
|
||||
|
||||
match_expected = utils.match_expected(
|
||||
value,
|
||||
validator_dict["expected"],
|
||||
validator_dict["comparator"]
|
||||
expected_value,
|
||||
validator_dict.get("comparator", "eq")
|
||||
)
|
||||
|
||||
if not match_expected:
|
||||
|
||||
Reference in New Issue
Block a user