Example #1
0
 def test_session_id_returns_cookie_auth_method(self):
     """If an existing session exists, use that session in cookie auth."""
     m = service._detect_auth_method(None,
                                     None,
                                     "session",
                                     "key",
                                     None,
                                     None,
                                     None)
     self.assertEqual(m, 'cookie')
Example #2
0
 def test_credentials_returns_cookie_auth_method(self):
     """If no method is specified, use cookie auth."""
     m = service._detect_auth_method("u", "pass", None, "key", None, None,
                                     None)
     self.assertEqual(m, 'cookie')
Example #3
0
 def test_secret_returns_oauth2_resource_owner_auth_method(self):
     """If we specify a client_id and secret then use OAuth2."""
     m = service._detect_auth_method(None, None, None, "key", "client_id",
                                     "secret", None)
     self.assertEqual(m, 'oauth2-resourceowner')
Example #4
0
 def test_secret_returns_oauth2_auth_method(self):
     m = service._detect_auth_method(None, None, None, "key", "secret",
                                     None)
     self.assertEqual(m, 'oauth2')
Example #5
0
 def test_no_apikey_raises_auth_method(self):
     with self.assertRaises(errors.ClientError):
         service._detect_auth_method(None, None, None, None, None, None)
Example #6
0
 def test_credentials_returns_cookie_auth_method(self):
     m = service._detect_auth_method("u", "pass", None, "key", None, None)
     self.assertEqual(m, 'cookie')
Example #7
0
 def test_session_id_returns_cookie_auth_method(self):
     m = service._detect_auth_method(None, None, "session", "key", None,
                                     None)
     self.assertEqual(m, 'cookie')
Example #8
0
 def test_no_apikey_raises_auth_method(self):
     with self.assertRaises(errors.ClientError):
         service._detect_auth_method(None, None, None, None, None, None)
Example #9
0
 def test_token_returns_oauth2_auth_method(self):
     m = service._detect_auth_method(None, None, None, "key", None, "token")
     self.assertEqual(m, 'oauth2')
Example #10
0
 def test_secret_returns_oauth2_auth_method(self):
     m = service._detect_auth_method(None, None, None, "key", "secret", None)
     self.assertEqual(m, 'oauth2')
Example #11
0
 def test_session_id_returns_cookie_auth_method(self):
     m = service._detect_auth_method(None, None, "session", "key", None, None)
     self.assertEqual(m, 'cookie')
Example #12
0
 def test_credentials_returns_cookie_auth_method(self):
     m = service._detect_auth_method("u", "pass", None, "key", None, None)
     self.assertEqual(m, 'cookie')
Example #13
0
 def test_token_returns_oauth2_auth_method(self):
     m = service._detect_auth_method(None, None, None, "key", None, "token")
     self.assertEqual(m, 'oauth2')
Example #14
0
 def test_secret_returns_oauth2_resource_owner_auth_method(self):
     m = service._detect_auth_method(None, None, None, "key", "client_id",
                                     "secret", None)
     self.assertEqual(m, 'oauth2')