summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/contexts
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-06 22:50:09 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-06 22:50:09 +0000
commit0a24ca320c46c10a50d38b8eab6336eb0e32f8c9 (patch)
treedd9d96e4b5659878c820436bac5a5ca6723d5329 /tests/unit/benchmark/contexts
parent3cce3bc588bef62e980cdcee3c9b7d6eac81bed2 (diff)
parent786ed9aa196ea940e9eafa35f40a4065e5e10536 (diff)
Merge "test_kubernetes: mock file operations in test_ssh_key"
Diffstat (limited to 'tests/unit/benchmark/contexts')
-rw-r--r--tests/unit/benchmark/contexts/test_kubernetes.py7
1 files changed, 6 insertions, 1 deletions
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)