Fix NoSuchOptError in lbaas agent test

Option 'periodic_interval' doesn't exist when using testtools
to test lbaas agent, fix this by adding a mock object.

Change-Id: I5ef02d6fa154ea7a18ca77d02a2704b7e3990c3b
Closes-Bug: #1264260
This commit is contained in:
Yuanchao Sun 2013-12-26 15:20:23 +08:00
parent e3797e36a4
commit d0dee69076

View File

@ -35,6 +35,7 @@ class TestLbaasService(base.BaseTestCase):
) as mock_start:
mgr = mock.Mock()
cfg.CONF.periodic_interval = mock.Mock(return_value=10)
agent_service = agent.LbaasAgentService('host', 'topic', mgr)
agent_service.start()