Stub out get_networks_count properly for pnet unit tests

Bug 1174457

Change-Id: I30a5c549d5d236124a7798a757601e970067b284
This commit is contained in:
Salvatore Orlando
2013-04-29 20:20:12 +02:00
parent 3aa3ba76a6
commit aa6ba83c20

View File

@@ -72,9 +72,11 @@ class ProvidernetExtensionTestCase(testlib_api.WebTestCase):
cfg.CONF.set_override('core_plugin', plugin)
cfg.CONF.set_override('allow_pagination', True)
cfg.CONF.set_override('allow_sorting', True)
cfg.CONF.set_override('quota_network', -1, group='QUOTAS')
self._plugin_patcher = mock.patch(plugin, autospec=True)
self.plugin = self._plugin_patcher.start()
# Ensure Quota checks never fail because of mock
instance = self.plugin.return_value
instance.get_networks_count.return_value = 1
# Instantiate mock plugin and enable the 'provider' extension
QuantumManager.get_plugin().supported_extension_aliases = (
["provider"])