mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-31 21:39:41 +08:00
Merge branch 'master' into bugfix
This commit is contained in:
@@ -168,12 +168,12 @@ class SessionContext(object):
|
|||||||
def validate(self, validators, resp_obj):
|
def validate(self, validators, resp_obj):
|
||||||
""" make validations
|
""" make validations
|
||||||
"""
|
"""
|
||||||
|
self.validation_results = []
|
||||||
if not validators:
|
if not validators:
|
||||||
return
|
return
|
||||||
|
|
||||||
logger.log_debug("start to validate.")
|
logger.log_debug("start to validate.")
|
||||||
|
|
||||||
self.validation_results = []
|
|
||||||
validate_pass = True
|
validate_pass = True
|
||||||
failures = []
|
failures = []
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,9 @@ class TestContext(ApiServerUnittest):
|
|||||||
self.context.init_test_variables(variables)
|
self.context.init_test_variables(variables)
|
||||||
self.context.validate(validators, resp_obj)
|
self.context.validate(validators, resp_obj)
|
||||||
|
|
||||||
|
self.context.validate([], resp_obj)
|
||||||
|
self.assertEqual(self.context.validation_results, [])
|
||||||
|
|
||||||
def test_validate_exception(self):
|
def test_validate_exception(self):
|
||||||
url = "http://127.0.0.1:5000/"
|
url = "http://127.0.0.1:5000/"
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
|
|||||||
Reference in New Issue
Block a user