mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-21 04:22:30 +08:00
feat: support alter response in teardown hooks
This commit is contained in:
@@ -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")
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user