def test_get_auth_token_different_auth(self): auth = HTTPNegotiateAuth() response = requests.Response() response.headers["www-authenticate"] = "Fake YWJj" expected = None actual = HTTPNegotiateAuth._get_auth_token(response, auth._regex) assert actual == expected
def test_get_auth_token_kerberos_auth(self, header): auth = HTTPNegotiateAuth() response = requests.Response() response.headers["www-authenticate"] = "%s YWJj" % header expected = b"abc" actual = HTTPNegotiateAuth._get_auth_token(response, auth._regex) assert actual == expected
def test_get_auth_token_present(self): auth = HTTPNegotiateAuth() response = requests.Response() response.headers["www-authenticate"] = "Negotiate YWJj" expected = b"abc" actual = HTTPNegotiateAuth._get_auth_token(response, auth._regex) assert actual == expected
def test_get_auth_token_no_header(self): auth = HTTPNegotiateAuth() response = requests.Response() expected = None actual = HTTPNegotiateAuth._get_auth_token(response, auth._regex) assert actual == expected