summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-06-13 11:57:33 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-06-13 11:57:33 +0800
commitf96063a0a7a116cd4018fc621b5bd3f3624fa813 (patch)
treef7f399af2b478cae0ae3e07cb0dd937f0cb14fb6 /vio
parent4c2d4e407dedc35c381ba71234ab67d30da52ed0 (diff)
Add test_get_vim_session_v3
Add test_get_vim_session_v3 Change-Id: Ifc37d19404cb7165fd2c3675c9f5e53d279f31b0 Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
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")