def test_determine_auth_method_none(self): # Try with digest auth url_field = URLField( "test_ping", "title", "this is a test" ) auth_type = WebPing.determine_auth_type( url_field.to_python("http://127.0.0.1:8888/test_page")) self.assertEquals(auth_type, WebPing.HTTP_AUTH_NONE)
def test_determine_auth_method_basic(self): # Try with basic auth url_field = URLField( "test_ping", "title", "this is a test" ) auth_type = WebPing.determine_auth_type( url_field.to_python("http://127.0.0.1:8888")) self.assertEquals(auth_type, WebPing.HTTP_AUTH_BASIC)
def test_determine_auth_method_digest(self): # Try with digest auth url_field = URLField( "test_ping", "title", "this is a test" ) auth_type = WebPing.determine_auth_type( url_field.to_python("http://httpbin.org/digest-auth/auth/user/passwd")) self.assertEquals(auth_type, WebPing.HTTP_AUTH_DIGEST)
def test_determine_auth_method_ntlm_comma_header(self): # Try with digest auth url_field = URLField( "test_ping", "title", "this is a test") auth_type = WebPing.determine_auth_type(url_field.to_python("http://127.0.0.1:" + str(self.web_server_port) + "/ntlm_auth_negotiate")) self.assertEqual(auth_type, WebPing.HTTP_AUTH_NTLM)