add tests for loading api with hooks

This commit is contained in:
httprunner
2018-06-10 23:24:30 +08:00
parent ff206a8202
commit 230478edfa
2 changed files with 18 additions and 2 deletions

View File

@@ -81,3 +81,17 @@
validate:
- eq: ["status_code", 200]
- eq: ["content.success", true]
- api:
def: get_headers($n_secs)
request:
url: /headers
method: GET
setup_hooks:
- ${setup_hook_add_kwargs($request)}
- ${setup_hook_remove_kwargs($request)}
teardown_hooks:
- ${teardown_hook_sleep_N_secs($response, $n_secs)}
validate:
- eq: ["status_code", 200]
- eq: [content.headers.Host, "127.0.0.1:3458"]