The test case for the periodic check was patching a target
that the core plugin fixture already patched out. This removes
that and exposes the mock from the fixture so the test case
can reference it.
Change-Id: I3adee6a875c497e070db4198567b52aa16b81ce8
Partial-Bug: #
1468998
CONF.set_override(k, v, group)
def setup_coreplugin(self, core_plugin=None):
- self.useFixture(PluginFixture(core_plugin))
+ cp = PluginFixture(core_plugin)
+ self.useFixture(cp)
+ self.patched_dhcp_periodic = cp.patched_dhcp_periodic
def setup_notification_driver(self, notification_driver=None):
self.addCleanup(fake_notifier.reset)
self.setup_coreplugin(DB_PLUGIN_KLASS)
cfg.CONF.set_override("network_scheduler_driver",
'neutron.scheduler.dhcp_agent_scheduler.WeightScheduler')
- self.dhcp_periodic_p = mock.patch(
- 'neutron.db.agentschedulers_db.DhcpAgentSchedulerDbMixin.'
- 'start_periodic_dhcp_agent_status_check')
- self.patched_dhcp_periodic = self.dhcp_periodic_p.start()
self.plugin = importutils.import_object('neutron.plugins.ml2.plugin.'
'Ml2Plugin')
self.assertEqual(1, self.patched_dhcp_periodic.call_count)