Ensure unit tests do not let looping calls roam freely

Bug 1220871

This patch does minimal changes in neutron.plugins.nicira.common.sync
providing unit tests with a reference to the looping call object, so
that they can control its lifecycle.
Also, it perform a bit of refactoring in test_l3_agent.py in the way
mocks are created and started.

Change-Id: I73a1eb8ecdb7c6d46ff12afba549dd27095b7202
This commit is contained in:
Salvatore Orlando 2013-09-04 12:22:23 -07:00
parent b35332c6b9
commit 226ca878d6
1 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,10 @@ class TestVPNAgent(base.BaseTestCase):
self.plugin_api = mock.Mock()
l3pluginApi_cls.return_value = self.plugin_api
looping_call_p = mock.patch(
'neutron.openstack.common.loopingcall.FixedIntervalLoopingCall')
looping_call_p.start()
self.fake_host = 'fake_host'
self.agent = agent.VPNAgent(self.fake_host)