summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-04-17 08:50:57 +0000
committerGerrit Code Review <review@openstack.org>2018-04-17 08:50:57 +0000
commitc16d15fff2953c7427dc2671dc479d044d5b90c3 (patch)
treedef216c3aeefd1ac9d937fd5d663cf9f8d83b25a
parentfb75ce03197e6cff66963d92609a2b3d18ed627e (diff)
parent5cf6663b9fd8f84f6e13bf8a71fe87ec0a7ba3c0 (diff)
Merge "tests: don't configure plugin for tests that don't need it"
-rw-r--r--neutron/tests/unit/objects/db/test_api.py9
-rw-r--r--neutron/tests/unit/objects/test_base.py5
-rw-r--r--neutron/tests/unit/objects/test_subnet.py5
3 files changed, 5 insertions, 14 deletions
diff --git a/neutron/tests/unit/objects/db/test_api.py b/neutron/tests/unit/objects/db/test_api.py
index beef8bc..da91546 100644
--- a/neutron/tests/unit/objects/db/test_api.py
+++ b/neutron/tests/unit/objects/db/test_api.py
@@ -25,9 +25,6 @@ from neutron.tests import base as test_base
25from neutron.tests.unit import testlib_api 25from neutron.tests.unit import testlib_api
26 26
27 27
28PLUGIN_NAME = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
29
30
31class FakeModel(object): 28class FakeModel(object):
32 def __init__(self, *args, **kwargs): 29 def __init__(self, *args, **kwargs):
33 pass 30 pass
@@ -39,12 +36,6 @@ class FakeObj(base.NeutronDbObject):
39 36
40class GetObjectsTestCase(test_base.BaseTestCase): 37class GetObjectsTestCase(test_base.BaseTestCase):
41 38
42 def setUp(self):
43 super(GetObjectsTestCase, self).setUp()
44 # TODO(ihrachys): revisit plugin setup once we decouple
45 # objects.db.objects.api from core plugin instance
46 self.setup_coreplugin(PLUGIN_NAME)
47
48 def test_get_objects_pass_marker_obj_when_limit_and_marker_passed(self): 39 def test_get_objects_pass_marker_obj_when_limit_and_marker_passed(self):
49 ctxt = context.get_admin_context() 40 ctxt = context.get_admin_context()
50 marker = mock.sentinel.marker 41 marker = mock.sentinel.marker
diff --git a/neutron/tests/unit/objects/test_base.py b/neutron/tests/unit/objects/test_base.py
index 821b7f3..6849816 100644
--- a/neutron/tests/unit/objects/test_base.py
+++ b/neutron/tests/unit/objects/test_base.py
@@ -559,13 +559,8 @@ class _BaseObjectTestCase(object):
559 559
560 _test_class = FakeNeutronDbObject 560 _test_class = FakeNeutronDbObject
561 561
562 CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
563
564 def setUp(self): 562 def setUp(self):
565 super(_BaseObjectTestCase, self).setUp() 563 super(_BaseObjectTestCase, self).setUp()
566 # TODO(ihrachys): revisit plugin setup once we decouple
567 # neutron.objects.db.api from core plugin instance
568 self.setup_coreplugin(self.CORE_PLUGIN)
569 # make sure all objects are loaded and registered in the registry 564 # make sure all objects are loaded and registered in the registry
570 objects.register_objects() 565 objects.register_objects()
571 self.context = context.get_admin_context() 566 self.context = context.get_admin_context()
diff --git a/neutron/tests/unit/objects/test_subnet.py b/neutron/tests/unit/objects/test_subnet.py
index 2ace9cd..f356170 100644
--- a/neutron/tests/unit/objects/test_subnet.py
+++ b/neutron/tests/unit/objects/test_subnet.py
@@ -148,8 +148,13 @@ class SubnetDbObjectTestCase(obj_test_base.BaseDbObjectTestCase,
148 148
149 _test_class = subnet.Subnet 149 _test_class = subnet.Subnet
150 150
151 CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
152
151 def setUp(self): 153 def setUp(self):
152 super(SubnetDbObjectTestCase, self).setUp() 154 super(SubnetDbObjectTestCase, self).setUp()
155 # set up plugin because some models used here require a plugin
156 # (specifically, rbac models and their get_valid_actions validators)
157 self.setup_coreplugin(self.CORE_PLUGIN)
153 network_id = self._create_test_network_id() 158 network_id = self._create_test_network_id()
154 self.update_obj_fields( 159 self.update_obj_fields(
155 {'network_id': network_id, 160 {'network_id': network_id,