summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vio/vio/tests/test_fake_identity_view.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_identity_view.py b/vio/vio/tests/test_fake_identity_view.py
index 1f7b395..8f3d23a 100644
--- a/vio/vio/tests/test_fake_identity_view.py
+++ b/vio/vio/tests/test_fake_identity_view.py
@@ -79,3 +79,15 @@ class TestFakeTokenV2(unittest.TestCase):
}
resp = self.view.get(mock.Mock())
self.assertEqual(200, resp.status_code)
+
+ @mock.patch("requests.post")
+ @mock.patch.object(fakeResponse, "keystone_tokenV2")
+ def test_create_token(self, mock_keystone_tokenV2, mock_post):
+ req = mock.Mock()
+ req.get_full_path.return_value = "identity/v2.0/tokens"
+ req.body = json.dumps(
+ {"auth": {"scope": {"project": {"id": "1234abcd"}}}})
+ mock_keystone_tokenV2.return_value = {
+ "token": {"value": Token}}
+ resp = self.view.post(req)
+ self.assertEqual(200, resp.status_code)