From c9354b529386f8e9071e13a63458a970ff42c854 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 14 May 2018 15:09:11 +0800 Subject: [PATCH] remove setup_hook_httpntlmauth from built-in hooks --- httprunner/built_in.py | 7 ------- tests/debugtalk.py | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/httprunner/built_in.py b/httprunner/built_in.py index 207bc671..32f94aad 100644 --- a/httprunner/built_in.py +++ b/httprunner/built_in.py @@ -143,13 +143,6 @@ def setup_hook_prepare_kwargs(request): if isinstance(request["data"], str): request["data"] = request["data"].encode('utf-8') -def setup_hook_httpntlmauth(request): - if "httpntlmauth" in request: - from requests_ntlm import HttpNtlmAuth - auth_account = request.pop("httpntlmauth") - request["auth"] = HttpNtlmAuth( - auth_account["username"], auth_account["password"]) - def sleep_N_secs(n_secs): """ sleep n seconds """ diff --git a/tests/debugtalk.py b/tests/debugtalk.py index c896456d..ca172c9b 100644 --- a/tests/debugtalk.py +++ b/tests/debugtalk.py @@ -87,3 +87,10 @@ def hook_print(msg): def modify_headers_os_platform(request, os_platform): request["headers"]["os_platform"] = os_platform + +def setup_hook_httpntlmauth(request): + if "httpntlmauth" in request: + from requests_ntlm import HttpNtlmAuth + auth_account = request.pop("httpntlmauth") + request["auth"] = HttpNtlmAuth( + auth_account["username"], auth_account["password"])