summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-03-27 11:28:26 -0700
committerEthan Lynn <ethanlynnl@vmware.com>2018-03-27 11:28:26 -0700
commit4723b5d862ca70adfed4eea05c4bd32074509746 (patch)
tree669cc9edd25f37e9a5ea5ffa3831bc6e1beed18d /vio
parent1b0ca48aa6d542b4d32f04f824b98c50b403ccbc (diff)
Add test_get_v2 for TokenV2View
Add test_get_v2 Change-Id: I2b22bd8fac30fe98d791162ed200d41697602c3b Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_proxy_identity_view.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/vio/vio/tests/test_proxy_identity_view.py b/vio/vio/tests/test_proxy_identity_view.py
index 19b77de..e7b1e15 100644
--- a/vio/vio/tests/test_proxy_identity_view.py
+++ b/vio/vio/tests/test_proxy_identity_view.py
@@ -168,3 +168,30 @@ class TestTokenView(unittest.TestCase):
mock_post.return_value = res
resp = self.view.post(req, "vmware_nova")
self.assertEqual(200, resp.status_code)
+
+
+class TestTokenV2View(unittest.TestCase):
+
+ def setUp(self):
+ self.view = views.TokenV2View()
+
+ @mock.patch("requests.get")
+ @mock.patch.object(extsys, "get_vim_by_id")
+ def test_get_v2(self, mock_getvim, mock_get):
+ req = mock.Mock()
+ req.get_full_path.return_value = "identity/v2.0"
+ mock_getvim.return_value = {
+ "url": "http://onap.org/identity/v3"
+ }
+ res = mock.Mock()
+ res.status_code = 200
+ res.json.return_value = {
+ "version": {
+ "links": [{
+ "href": ""
+ }]
+ }
+ }
+ mock_get.return_value = res
+ resp = self.view.get(req, "vmware_nova")
+ self.assertEqual(resp.status_code, 200)