コード例 #1
0
 def test_get_token_returns_token_on_success(self):
     _prepare_mock_post(status=200,
                        body='{"access": {"token": {"id": "token"}}}')
     token = auth.get_token(username='******', password='******')
     self.assertEqual(token, 'token')
コード例 #2
0
 def test_get_token_returns_token_on_success(self):
     _prepare_mock_post(status=200,
                        body='{"access": {"token": {"id": "token"}}}')
     token = auth.get_token(username='******', password='******')
     self.assertEqual(token, 'token')
コード例 #3
0
 def test_get_token_by_apikey_raises_if_invalid_creds(self):
     _prepare_mock_post(status=403)
     with self.assertRaises(HTTPError):
         auth.get_token(apikey='bad', username='******')
コード例 #4
0
 def test_get_token_by_apikey_raises_if_invalid_creds(self):
     _prepare_mock_post(status=403)
     with self.assertRaises(HTTPError):
         auth.get_token(apikey='bad', username='******')