aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-02-19 16:06:50 +0000
committerEmma Foley <emma.l.foley@intel.com>2018-03-02 19:08:37 +0000
commit24a8c6d89f150666a37a3f8daba0fce7c17a436a (patch)
tree888e25fc09d65bda2bdfacbf8c24f4c19143f9ef /yardstick/tests/unit
parenta74ad5a1ec1a73389c5983440b2031b0bc72cea1 (diff)
Add yardstick.benchmark.contexts.heat.HeatContext._delete_key_file()
* Move logic for removing key file into its own method * Update the log message to be more useful JIRA: YARDSTICK-1026 Change-Id: I8c131720ed91c939698c41ad63d586396fcce1fe Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/tests/unit')
-rw-r--r--yardstick/tests/unit/benchmark/contexts/test_heat.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yardstick/tests/unit/benchmark/contexts/test_heat.py b/yardstick/tests/unit/benchmark/contexts/test_heat.py
index c449b2a28..f66133b2c 100644
--- a/yardstick/tests/unit/benchmark/contexts/test_heat.py
+++ b/yardstick/tests/unit/benchmark/contexts/test_heat.py
@@ -355,8 +355,9 @@ class HeatContextTestCase(unittest.TestCase):
self.assertDictEqual(server.interfaces['port_a'], expected)
@mock.patch('yardstick.benchmark.contexts.heat.os')
+ @mock.patch.object(heat.HeatContext, '_delete_key_file')
@mock.patch('yardstick.benchmark.contexts.heat.HeatTemplate')
- def test_undeploy(self, mock_template, *args):
+ def test_undeploy(self, mock_template, mock_delete_key, *args):
self.test_context.stack = mock_template
self.test_context._name = 'foo'
self.test_context._task_id = '1234567890'
@@ -365,6 +366,7 @@ class HeatContextTestCase(unittest.TestCase):
# mock_os.path.exists.return_value = True
self.test_context.key_filename = 'foo/bar/foobar'
self.test_context.undeploy()
+ mock_delete_key.assert_called()
self.assertTrue(mock_template.delete.called)
@mock.patch('yardstick.benchmark.contexts.heat.HeatTemplate')