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

View File

@@ -20,3 +20,17 @@
validate:
- eq: ["status_code", 200]
- eq: [content.headers.Host, "127.0.0.1:3458"]
- test:
name: alter response
request:
url: /headers
method: GET
teardown_hooks:
- ${alter_response($response)}
validate:
- eq: ["status_code", 500]
- eq: ["headers.content-type", "html/text"]
- eq: [json.headers.Host, "127.0.0.1:8888"]
- eq: [content.headers.Host, "127.0.0.1:3458"]
- eq: [text.headers.Host, "127.0.0.1:3458"]