mock post request in acl test

This commit is contained in:
Tamar Ben-Shachar
2016-02-12 11:56:00 -08:00
parent ec057e119f
commit 5d6c380d1c

View File

@@ -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