Merge "shim _setUpExtension in prep to changing args"
This commit is contained in:
commit
892dab2df4
@ -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 {}
|
||||
|
@ -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()
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user