summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_apiv2_controller.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/vio/vio/tests/test_apiv2_controller.py b/vio/vio/tests/test_apiv2_controller.py
index 79182b0..c769180 100644
--- a/vio/vio/tests/test_apiv2_controller.py
+++ b/vio/vio/tests/test_apiv2_controller.py
@@ -14,6 +14,7 @@ import mock
import unittest
from keystoneauth1.identity import v2 as keystone_v2
+from keystoneauth1.identity import v3 as keystone_v3
from vio.api_v2.api_router import controller_builder as cb
from vio.pub.msapi import extsys
@@ -32,3 +33,15 @@ class TestAPIv2Controller(unittest.TestCase):
}
mock_kv2.return_value = mock.Mock()
cb._get_vim_auth_session("vmware_vio", "tenant1")
+
+ @mock.patch.object(keystone_v3, "Password")
+ @mock.patch.object(extsys, "get_vim_by_id")
+ def test_get_vim_session_v3(self, mock_getvim, mock_kv3):
+ mock_getvim.return_value = {
+ "url": "http://aa/v3",
+ "userName": "admin",
+ "password": "admin",
+ "domain": "default"
+ }
+ mock_kv3.return_value = mock.Mock()
+ cb._get_vim_auth_session("vmware_vio", "tenant1")