Remove unnecessary mocks from unit test

These mocks where added in the series [1] when we rejected server
operations with qos port. But then we forgot to remove them when
the support is added to those operations during [2].

[1] https://review.opendev.org/q/topic:bp/bandwidth-resource-provider
[2] https://review.opendev.org/q/topic:bp/support-move-ops-with-qos-ports-ussuri

Change-Id: Idbc2d6b2f8f50924dc84683f9701aa28007616af
This commit is contained in:
Balazs Gibizer 2021-06-03 18:31:01 +02:00
parent 84cfbddf34
commit bfde686130
3 changed files with 0 additions and 13 deletions

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import fixtures
import mock import mock
from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils.fixture import uuidsentinel as uuids
import testtools import testtools
@ -67,9 +66,6 @@ class EvacuateTestV21(test.NoDBTestCase):
self.stub_out('nova.compute.api.API.get', fake_compute_api_get) self.stub_out('nova.compute.api.API.get', fake_compute_api_get)
self.stub_out('nova.compute.api.HostAPI.service_get_by_compute_host', self.stub_out('nova.compute.api.HostAPI.service_get_by_compute_host',
fake_service_get_by_compute_host) fake_service_get_by_compute_host)
self.mock_list_port = self.useFixture(
fixtures.MockPatch('nova.network.neutron.API.list_ports')).mock
self.mock_list_port.return_value = {'ports': []}
self.UUID = uuids.fake self.UUID = uuids.fake
for _method in self._methods: for _method in self._methods:
self.stub_out('nova.compute.api.API.%s' % _method, self.stub_out('nova.compute.api.API.%s' % _method,

View File

@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import fixtures
import mock import mock
from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils import uuidutils from oslo_utils import uuidutils
@ -45,9 +44,6 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
self.stub_out('nova.api.openstack.compute.migrate_server.' self.stub_out('nova.api.openstack.compute.migrate_server.'
'MigrateServerController', 'MigrateServerController',
lambda *a, **kw: self.controller) lambda *a, **kw: self.controller)
self.mock_list_port = self.useFixture(
fixtures.MockPatch('nova.network.neutron.API.list_ports')).mock
self.mock_list_port.return_value = {'ports': []}
def _get_migration_body(self, **kwargs): def _get_migration_body(self, **kwargs):
return {'os-migrateLive': self._get_params(**kwargs)} return {'os-migrateLive': self._get_params(**kwargs)}

View File

@ -14,7 +14,6 @@
# under the License. # under the License.
import ddt import ddt
import fixtures
import mock import mock
from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils import uuidutils from oslo_utils import uuidutils
@ -100,10 +99,6 @@ class ServerActionsControllerTestV21(test.TestCase):
self.controller.compute_api, 'compute_task_api') self.controller.compute_api, 'compute_task_api')
mock_conductor.start() mock_conductor.start()
self.addCleanup(mock_conductor.stop) self.addCleanup(mock_conductor.stop)
# Assume that none of the tests are using ports with resource requests.
self.mock_list_port = self.useFixture(
fixtures.MockPatch('nova.network.neutron.API.list_ports')).mock
self.mock_list_port.return_value = {'ports': []}
def _get_controller(self): def _get_controller(self):
return self.servers.ServersController() return self.servers.ServersController()