#29: refactor validator:

1, relocate validate functions;
2, add unittest for custom defined validators.
This commit is contained in:
httprunner
2017-12-12 23:59:54 +08:00
parent 0e1ef7f78f
commit 6ac43e39ea
9 changed files with 139 additions and 117 deletions

View File

@@ -129,11 +129,7 @@ class Runner(object):
self.context.bind_extracted_variables(extracted_variables_mapping)
try:
resp_obj.validate(
validators,
self.context.get_testcase_variables_mapping(),
self.context.get_testcase_functions_mapping()
)
self.context.validate(validators, resp_obj)
except (exception.ParamsError, exception.ResponseError, exception.ValidationError):
err_msg = u"Exception occured.\n"
err_msg += u"HTTP request url: {}\n".format(url)