]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix NoSuchOptError in lbaas agent test
authorYuanchao Sun <yuanchao.sun@gmail.com>
Thu, 26 Dec 2013 07:20:23 +0000 (15:20 +0800)
committerYuanchao Sun <yuanchao.sun@gmail.com>
Thu, 26 Dec 2013 12:13:40 +0000 (20:13 +0800)
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

neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py

index 201b2ca90b532ca9109dc67d5061d53307796498..7d27d517e5ad9ec233a0e0a9884b9d98f0db7695 100644 (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()