예제 #1
0
    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"])
예제 #2
0
 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: ''"
예제 #3
0
    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"])
예제 #4
0
 def test_auth_supported_multiple(self):
     response = requests.Response()
     response.headers[
         "www-authenticate"] = "Negotiate, CredSSP, Basic Realm='WSMan'"
     HTTPNegotiateAuth._check_auth_supported(response, "Negotiate")
예제 #5
0
 def test_auth_supported(self):
     response = requests.Response()
     response.headers["www-authenticate"] = "Negotiate"
     HTTPNegotiateAuth._check_auth_supported(response, "Negotiate")