From b25ec3552ab20a18b07155929a218820428d0f63 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 20 Feb 2019 11:51:30 +0800 Subject: [PATCH] update modify_request_json --- tests/debugtalk.py | 4 ++-- tests/test_runner.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/debugtalk.py b/tests/debugtalk.py index 87a7ee8b..74b9a3d3 100644 --- a/tests/debugtalk.py +++ b/tests/debugtalk.py @@ -89,8 +89,8 @@ def teardown_hook_sleep_N_secs(response, n_secs): def hook_print(msg): print(msg) -def modify_headers_os_platform(request, os_platform): - request["headers"]["os_platform"] = os_platform +def modify_request_json(request, os_platform): + request["json"]["os_platform"] = os_platform def setup_hook_httpntlmauth(request): if "httpntlmauth" in request: diff --git a/tests/test_runner.py b/tests/test_runner.py index 5917205f..38d5f508 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -164,19 +164,19 @@ class TestRunner(ApiServerUnittest): "method": "POST", "headers": { "content-type": "application/json", - "user_agent": "iOS/10.3", - "os_platform": "ios" + "user_agent": "iOS/10.3" }, "json": { + "os_platform": "ios", "sign": "f1219719911caae89ccc301679857ebfda115ca2" } }, "setup_hooks": [ - "${modify_headers_os_platform($request, android)}" + "${modify_request_json($request, android)}" ], "validate": [ {"check": "status_code", "expect": 200}, - {"check": "content.headers.Os-Platform", "expect": "android"} + {"check": "content.json.os_platform", "expect": "android"} ] } test_runner = runner.Runner(config_dict, self.debugtalk_functions)