summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/orchestrator/test_heat.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unit/orchestrator/test_heat.py b/tests/unit/orchestrator/test_heat.py
index 19d91c6e8..c127dd0c9 100644
--- a/tests/unit/orchestrator/test_heat.py
+++ b/tests/unit/orchestrator/test_heat.py
@@ -345,8 +345,10 @@ class HeatStackTestCase(unittest.TestCase):
@mock.patch('yardstick.orchestrator.heat.op_utils')
def test_delete_all_calls_delete(self, mock_op):
- stack = heat.HeatStack('test')
- stack.uuid = 1
- with mock.patch.object(stack, "delete") as delete_mock:
+ # we must patch the object before we create an instance
+ # so we can override delete() in all the instances
+ with mock.patch.object(heat.HeatStack, "delete") as delete_mock:
+ stack = heat.HeatStack('test')
+ stack.uuid = 1
stack.delete_all()
- self.assertGreater(delete_mock.call_count, 0)
+ self.assertGreater(delete_mock.call_count, 0)