feat: support alter response in teardown hooks

This commit is contained in:
debugtalk
2020-06-07 19:04:06 +08:00
parent 9367cac706
commit 5c06b91b62
18 changed files with 54 additions and 32 deletions

View File

@@ -24,8 +24,10 @@ class TestCaseHooks(HttpRunner):
.get("/headers")
.teardown_hook("${alter_response($response)}")
.validate()
.assert_equal("status_code", 200)
.assert_equal("body.headers.Host", "httpbin.org")
.assert_equal("status_code", 500)
.assert_equal('headers."Content-Type"', "html/text")
.assert_equal('body.headers."Content-Type"', "application/json")
.assert_equal("body.headers.Host", "127.0.0.1:8888")
),
]