1 # Copyright (c) 2017-2018 VMware, Inc.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 from multivimbroker.pub.msapi import extsys
15 from multivimbroker.pub.utils import syscomm
18 class TestSyscomm(unittest.TestCase):
20 def test_getVIMTypes(self):
22 "openstack": ["titanium_cloud", "ocata"],
25 ret = syscomm.getVIMTypes()
27 for v in item['versions']:
28 self.assertIn(v, expected_body[item['vim_type']])
30 @mock.patch.object(extsys, "get_vim_by_id")
31 def test_getMultivimDriver(self, mock_get_vim):
32 mock_get_vim.return_value = {
36 full_path = "multicloud/v0/openstack_regionone/identity"
37 expect_path = "multicloud-ocata/v0/openstack_regionone/identity"
38 ret_path = syscomm.getMultivimDriver("openstack_regionone", full_path)
39 self.assertEqual(expect_path, ret_path)