diff --git a/neutron/tests/unit/extensions/base.py b/neutron/tests/unit/extensions/base.py index c1cfdbbaecd..2816d731cfc 100644 --- a/neutron/tests/unit/extensions/base.py +++ b/neutron/tests/unit/extensions/base.py @@ -36,16 +36,31 @@ CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' class ExtensionTestCase(testlib_api.WebTestCase): - # TODO(boden): phase out resource_attribute_map + # TODO(boden): remove once all consumers use _setup_extension def _setUpExtension(self, plugin, service_type, - resource_attribute_map, + _resource_attribute_map, extension_class, resource_prefix, plural_mappings=None, translate_resource_name=False, allow_pagination=False, allow_sorting=False, supported_extension_aliases=None, - use_quota=False, - ): + use_quota=False): + return self.setup_extension( + plugin, service_type, + extension_class, + resource_prefix, plural_mappings=None, + translate_resource_name=False, + allow_pagination=False, allow_sorting=False, + supported_extension_aliases=None, + use_quota=False) + + def setup_extension(self, plugin, service_type, + extension_class, + resource_prefix, plural_mappings=None, + translate_resource_name=False, + allow_pagination=False, allow_sorting=False, + supported_extension_aliases=None, + use_quota=False): self._resource_prefix = resource_prefix self._plural_mappings = plural_mappings or {} diff --git a/neutron/tests/unit/extensions/test_flavors.py b/neutron/tests/unit/extensions/test_flavors.py index da9ad913ee3..d034ea5cc2e 100644 --- a/neutron/tests/unit/extensions/test_flavors.py +++ b/neutron/tests/unit/extensions/test_flavors.py @@ -52,10 +52,10 @@ class FlavorExtensionTestCase(extension.ExtensionTestCase): def setUp(self): super(FlavorExtensionTestCase, self).setUp() - self._setUpExtension( + self.setup_extension( 'neutron.services.flavors.flavors_plugin.FlavorsPlugin', - constants.FLAVORS, {}, - flavors.Flavors, '', supported_extension_aliases=['flavors']) + constants.FLAVORS, flavors.Flavors, '', + supported_extension_aliases=['flavors']) def test_create_flavor(self): tenant_id = uuidutils.generate_uuid() diff --git a/neutron/tests/unit/extensions/test_l3.py b/neutron/tests/unit/extensions/test_l3.py index 590fa8d81c6..e73b55cc12f 100644 --- a/neutron/tests/unit/extensions/test_l3.py +++ b/neutron/tests/unit/extensions/test_l3.py @@ -92,11 +92,10 @@ class L3NatExtensionTestCase(test_extensions_base.ExtensionTestCase): def setUp(self): super(L3NatExtensionTestCase, self).setUp() - self._setUpExtension( + self.setup_extension( 'neutron.services.l3_router.l3_router_plugin.L3RouterPlugin', - plugin_constants.L3, {}, - l3.L3, '', allow_pagination=True, allow_sorting=True, - supported_extension_aliases=['router'], + plugin_constants.L3, l3.L3, '', allow_pagination=True, + allow_sorting=True, supported_extension_aliases=['router'], use_quota=True) def test_router_create(self):