diff options
Diffstat (limited to 'tests/unit/benchmark/contexts')
-rw-r--r-- | tests/unit/benchmark/contexts/test_heat.py | 3 | ||||
-rw-r--r-- | tests/unit/benchmark/contexts/test_kubernetes.py | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/unit/benchmark/contexts/test_heat.py b/tests/unit/benchmark/contexts/test_heat.py index 658a8e580..cc0c7bc8e 100644 --- a/tests/unit/benchmark/contexts/test_heat.py +++ b/tests/unit/benchmark/contexts/test_heat.py @@ -185,9 +185,7 @@ class HeatContextTestCase(unittest.TestCase): def test_add_server_port(self): network1 = mock.MagicMock() - network1.vld_id = 'vld111' network2 = mock.MagicMock() - network2.vld_id = 'vld777' self.test_context.name = 'foo' self.test_context.stack = mock.MagicMock() self.test_context.networks = { @@ -229,7 +227,6 @@ class HeatContextTestCase(unittest.TestCase): "network_name": 'a', "local_mac": '00:01', "local_ip": '10.20.30.45', - "vld_id": 'vld111', } self.test_context.add_server_port(server) self.assertEqual(server.private_ip, '10.20.30.45') diff --git a/tests/unit/benchmark/contexts/test_kubernetes.py b/tests/unit/benchmark/contexts/test_kubernetes.py index b0ee792db..4976a9fe0 100644 --- a/tests/unit/benchmark/contexts/test_kubernetes.py +++ b/tests/unit/benchmark/contexts/test_kubernetes.py @@ -81,9 +81,14 @@ class KubernetesTestCase(unittest.TestCase): self.assertTrue(mock_get_rc_pods.called) self.assertTrue(mock_wait_until_running.called) + @mock.patch('{}.paramiko'.format(prefix), **{"resource_filename.return_value": ""}) + @mock.patch('{}.pkg_resources'.format(prefix), **{"resource_filename.return_value": ""}) + @mock.patch('{}.utils'.format(prefix)) + @mock.patch('{}.open'.format(prefix), create=True) @mock.patch('{}.k8s_utils.delete_config_map'.format(prefix)) @mock.patch('{}.k8s_utils.create_config_map'.format(prefix)) - def test_ssh_key(self, mock_create, mock_delete): + def test_ssh_key(self, mock_create, mock_delete, mock_open, mock_utils, mock_resources, + mock_paramiko): k8s_context = KubernetesContext() k8s_context.init(context_cfg) |