From 76c28812013c558041612609efe30b88a5226267 Mon Sep 17 00:00:00 2001 From: LIU Yulong Date: Mon, 17 Dec 2018 10:35:33 +0800 Subject: [PATCH] Make test service_plugins override simple Just make things simple and give a chance to accept that ordered 'service_plugins' list or tuple for the base test class NeutronDbPluginV2TestCase. Change-Id: I7c352ede811703e3a96848378b92cbbf5e109228 Related-Bug: #1809238 --- neutron/tests/unit/db/test_db_base_plugin_v2.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/neutron/tests/unit/db/test_db_base_plugin_v2.py b/neutron/tests/unit/db/test_db_base_plugin_v2.py index 5020f286b45..22fdef55c3e 100644 --- a/neutron/tests/unit/db/test_db_base_plugin_v2.py +++ b/neutron/tests/unit/db/test_db_base_plugin_v2.py @@ -131,11 +131,15 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase): 'DhcpAgentNotifyAPI').start() # Update the plugin self.setup_coreplugin(plugin, load_plugins=False) - cfg.CONF.set_override( - 'service_plugins', - [test_lib.test_config.get(key, default) - for key, default in (service_plugins or {}).items()] - ) + if isinstance(service_plugins, (list, tuple)): + # Sometimes we needs these test service_plugins to be ordered. + cfg.CONF.set_override('service_plugins', service_plugins) + else: + cfg.CONF.set_override( + 'service_plugins', + [test_lib.test_config.get(key, default) + for key, default in (service_plugins or {}).items()] + ) cfg.CONF.set_override('base_mac', "12:34:56:78:00:00") cfg.CONF.set_override('max_dns_nameservers', 2)