1, refactor ResponseObject;
2, response can be modified in teardown_hooks.
This commit is contained in:
httprunner
2018-05-31 00:36:10 +08:00
parent c23016f3c1
commit 89cc9a2d1e
9 changed files with 142 additions and 162 deletions

View File

@@ -94,3 +94,8 @@ def setup_hook_httpntlmauth(request):
auth_account = request.pop("httpntlmauth")
request["auth"] = HttpNtlmAuth(
auth_account["username"], auth_account["password"])
def alter_response(response):
response.status_code = 500
response.headers["Content-Type"] = "html/text"
response.json["headers"]["Host"] = "127.0.0.1:8888"