Merge "tests: don't configure plugin for tests that don't need it"

This commit is contained in:
Zuul 2018-04-17 08:50:57 +00:00 committed by Gerrit Code Review
commit c16d15fff2
3 changed files with 5 additions and 14 deletions

View File

@ -25,9 +25,6 @@ from neutron.tests import base as test_base
from neutron.tests.unit import testlib_api
PLUGIN_NAME = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
class FakeModel(object):
def __init__(self, *args, **kwargs):
pass
@ -39,12 +36,6 @@ class FakeObj(base.NeutronDbObject):
class GetObjectsTestCase(test_base.BaseTestCase):
def setUp(self):
super(GetObjectsTestCase, self).setUp()
# TODO(ihrachys): revisit plugin setup once we decouple
# objects.db.objects.api from core plugin instance
self.setup_coreplugin(PLUGIN_NAME)
def test_get_objects_pass_marker_obj_when_limit_and_marker_passed(self):
ctxt = context.get_admin_context()
marker = mock.sentinel.marker

View File

@ -559,13 +559,8 @@ class _BaseObjectTestCase(object):
_test_class = FakeNeutronDbObject
CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
def setUp(self):
super(_BaseObjectTestCase, self).setUp()
# TODO(ihrachys): revisit plugin setup once we decouple
# neutron.objects.db.api from core plugin instance
self.setup_coreplugin(self.CORE_PLUGIN)
# make sure all objects are loaded and registered in the registry
objects.register_objects()
self.context = context.get_admin_context()

View File

@ -148,8 +148,13 @@ class SubnetDbObjectTestCase(obj_test_base.BaseDbObjectTestCase,
_test_class = subnet.Subnet
CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
def setUp(self):
super(SubnetDbObjectTestCase, self).setUp()
# set up plugin because some models used here require a plugin
# (specifically, rbac models and their get_valid_actions validators)
self.setup_coreplugin(self.CORE_PLUGIN)
network_id = self._create_test_network_id()
self.update_obj_fields(
{'network_id': network_id,