From 493a3135edd3b8b9464f1f09dcb0f3ef762087f1 Mon Sep 17 00:00:00 2001 From: Anh Tran Date: Thu, 26 May 2016 11:20:30 +0700 Subject: [PATCH] Stop using mox stubs in test_evacuate.py Replace 'stubs.Set' with 'stub_out' in nova/tests/unit/api/openstack/compute/test_evacuate.py Part of blueprint remove-mox-ocata Change-Id: I5c9180d0424042d7e966287d2ac7faf9271c136f --- .../tests/unit/api/openstack/compute/test_evacuate.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nova/tests/unit/api/openstack/compute/test_evacuate.py b/nova/tests/unit/api/openstack/compute/test_evacuate.py index 1b3013c20ad7..9d4b605ac70f 100644 --- a/nova/tests/unit/api/openstack/compute/test_evacuate.py +++ b/nova/tests/unit/api/openstack/compute/test_evacuate.py @@ -62,12 +62,13 @@ class EvacuateTestV21(test.NoDBTestCase): def setUp(self): super(EvacuateTestV21, self).setUp() - self.stubs.Set(compute_api.API, 'get', fake_compute_api_get) - self.stubs.Set(compute_api.HostAPI, 'service_get_by_compute_host', - fake_service_get_by_compute_host) + self.stub_out('nova.compute.api.API.get', fake_compute_api_get) + self.stub_out('nova.compute.api.HostAPI.service_get_by_compute_host', + fake_service_get_by_compute_host) self.UUID = uuid.uuid4() for _method in self._methods: - self.stubs.Set(compute_api.API, _method, fake_compute_api) + self.stub_out('nova.compute.api.API.%s' % _method, + fake_compute_api) self._set_up_controller() self.admin_req = fakes.HTTPRequest.blank('', use_admin_context=True) self.req = fakes.HTTPRequest.blank('') @@ -110,7 +111,7 @@ class EvacuateTestV21(test.NoDBTestCase): def fake_evacuate(*args, **kwargs): raise exception.ComputeServiceInUse("Service still in use") - self.stubs.Set(compute_api.API, 'evacuate', fake_evacuate) + self.stub_out('nova.compute.api.API.evacuate', fake_evacuate) self._check_evacuate_failure(webob.exc.HTTPBadRequest, {'host': 'my-host', 'onSharedStorage': 'False',