From f509623e32bfbff1a27eaa07675bbec0662305aa Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 5 Nov 2013 11:09:56 +0100 Subject: [PATCH] Fix failing nova_tests tests Mock also compute.conductor_api.instance_destroy() to return an instance instead of a MagickMock object. Change-Id: I518e063abfdd568f7d9ef970bc371eced2198adf --- nova_tests/test_notifier.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nova_tests/test_notifier.py b/nova_tests/test_notifier.py index 9027ca352..1773227a6 100644 --- a/nova_tests/test_notifier.py +++ b/nova_tests/test_notifier.py @@ -221,8 +221,11 @@ class TestNovaNotifier(test.BaseTestCase): mock.patch('nova.openstack.common.notifier.rpc_notifier.notify', self.notify) ): - self.compute.terminate_instance(self.context, - instance=self.instance) + with mock.patch.object(self.compute.conductor_api, + 'instance_destroy', + return_value=self.instance): + self.compute.terminate_instance(self.context, + instance=self.instance) def tearDown(self): self.Pollster.instances = []