diff options
author | Bin Sun <bins@vmware.com> | 2018-04-12 10:54:11 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-12 10:54:33 +0800 |
commit | d2615457d2331bf77767cb753ae735a91b1663c5 (patch) | |
tree | 6dfe8606024681796b2f9ef687cc2228ec7c97d8 | |
parent | 4632a6e222e089aa47bb6e8439c908d43c204ede (diff) |
Add fake get token v2 test
Change-Id: I99320ff40a3d38a8f226637f9410f8a1e7ac642e
Issue-ID: MULTICLOUD-199
Signed-off-by: Bin Sun <bins@vmware.com>
-rw-r--r-- | vio/vio/tests/test_fake_identity_view.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/vio/vio/tests/test_fake_identity_view.py b/vio/vio/tests/test_fake_identity_view.py index f8c673e..1f7b395 100644 --- a/vio/vio/tests/test_fake_identity_view.py +++ b/vio/vio/tests/test_fake_identity_view.py @@ -49,7 +49,7 @@ class TestFakeToken(unittest.TestCase): @mock.patch.object(fakeResponse, "keystone_version") def test_get_token(self, mock_keystone_version): mock_keystone_version.return_value = { - "version": "v2" + "version": "v3" } resp = self.view.get(mock.Mock()) self.assertEqual(200, resp.status_code) @@ -65,3 +65,17 @@ class TestFakeToken(unittest.TestCase): "token": {"value": Token}} resp = self.view.post(req) self.assertEqual(201, resp.status_code) + + +class TestFakeTokenV2(unittest.TestCase): + + def setUp(self): + self.view = views.FakeTokenV2() + + @mock.patch.object(fakeResponse, "keystone_version2") + def test_get_tokenV2(self, mock_keystone_version2): + mock_keystone_version2.return_value = { + "version": "v2" + } + resp = self.view.get(mock.Mock()) + self.assertEqual(200, resp.status_code) |