change validators from dict to list, as there may be several tests on one filed

This commit is contained in:
httprunner
2017-06-29 18:13:50 +08:00
parent d21f041437
commit 87ef0b3cd6
12 changed files with 107 additions and 108 deletions

View File

@@ -59,10 +59,10 @@ class TestRunner(object):
"body": '{"name": "user", "password": "123456"}'
},
"extract_binds": {},
"validators": {}
"validators": []
}
@return (tuple) test result of single testcase
(success, diff_content)
(success, diff_content_list)
"""
self.update_context(testcase)
parsed_request = parse_template(testcase["request"], self.context.variables)
@@ -80,10 +80,10 @@ class TestRunner(object):
extracted_variables_mapping = resp_obj.extract_response(extract_binds)
self.context.update_variables(extracted_variables_mapping)
validators = testcase.get("validators", {})
diff_content_dict = resp_obj.validate(validators, self.context.variables)
validators = testcase.get("validators", [])
diff_content_list = resp_obj.validate(validators, self.context.variables)
return resp_obj.success, diff_content_dict
return resp_obj.success, diff_content_list
def run_testset(self, testset):
""" run single testset, including one or several testcases.