def test_auth_not_supported_no_header(self): response = requests.Response() expected = "The server did not response with one of the following authentication methods Negotiate - " \ "actual: ''" with pytest.raises(AuthenticationError, match=re.escape(expected)): HTTPNegotiateAuth._check_auth_supported(response, ["Negotiate"])
def test_auth_not_supported_no_header(self): response = requests.Response() with pytest.raises(AuthenticationError) as err: HTTPNegotiateAuth._check_auth_supported(response, "Negotiate") assert str(err.value) == \ "The server did not response with the authentication method of " \ "Negotiate - actual: ''"
def test_auth_not_supported(self): response = requests.Response() response.headers["www-authenticate"] = "CredSSP" expected = ( "The server did not response with one of the following authentication methods Negotiate - " "actual: 'CredSSP'") with pytest.raises(AuthenticationError, match=re.escape(expected)): HTTPNegotiateAuth._check_auth_supported(response, ["Negotiate"])
def test_auth_supported_multiple(self): response = requests.Response() response.headers[ "www-authenticate"] = "Negotiate, CredSSP, Basic Realm='WSMan'" HTTPNegotiateAuth._check_auth_supported(response, "Negotiate")
def test_auth_supported(self): response = requests.Response() response.headers["www-authenticate"] = "Negotiate" HTTPNegotiateAuth._check_auth_supported(response, "Negotiate")