From 5d6c380d1ce8d8675e4fe87baae1099b043c8b99 Mon Sep 17 00:00:00 2001 From: Tamar Ben-Shachar Date: Fri, 12 Feb 2016 11:56:00 -0800 Subject: [PATCH] mock post request in acl test --- cli/tests/integrations/test_http_auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/tests/integrations/test_http_auth.py b/cli/tests/integrations/test_http_auth.py index 9dfe58e..4b0f5a8 100644 --- a/cli/tests/integrations/test_http_auth.py +++ b/cli/tests/integrations/test_http_auth.py @@ -70,11 +70,13 @@ def test_get_http_auth_credentials_basic(auth_mock): @patch('dcos.http._get_auth_credentials') -def test_get_http_auth_credentials_acl(auth_mock): +@patch('dcos.http._request') +def test_get_http_auth_credentials_acl(req_mock, auth_mock): m = Mock() m.url = 'http://domain.com' m.headers = {'www-authenticate': 'acsjwt"'} auth_mock.return_value = ("username", "password") + req_mock.status_code = 404 returned_auth = http._get_http_auth(m, urlparse(m.url), "acsjwt") assert type(returned_auth) == http.DCOSAcsAuth