#29: refactor validator, now support custom defined validators

This commit is contained in:
httprunner
2017-12-12 20:06:54 +08:00
parent 8c19212c6f
commit 155ad0167e
8 changed files with 234 additions and 129 deletions

View File

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