summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)