From 6bb8b1df88544ac6b5ab16938960ef7f994f96e2 Mon Sep 17 00:00:00 2001 From: gongysh Date: Fri, 1 Mar 2013 15:36:19 +0800 Subject: [PATCH] mock quantum.agent.common.config.setup_logging Bug #1137249 Change-Id: I7eb7ec3c0247c1ceeefc8e3f88d9cd7753c38c0c --- .../tests/unit/services/agent_loadbalancer/agent/test_init.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quantum/tests/unit/services/agent_loadbalancer/agent/test_init.py b/quantum/tests/unit/services/agent_loadbalancer/agent/test_init.py index f2e9f22808..a33a36519e 100644 --- a/quantum/tests/unit/services/agent_loadbalancer/agent/test_init.py +++ b/quantum/tests/unit/services/agent_loadbalancer/agent/test_init.py @@ -43,12 +43,14 @@ class TestLbaasService(testtools.TestCase): self.assertTrue(mock_start.called) def test_main(self): + logging_str = 'quantum.agent.common.config.setup_logging' with contextlib.nested( + mock.patch(logging_str), mock.patch.object(agent.service, 'launch'), mock.patch.object(agent, 'eventlet'), mock.patch('sys.argv'), mock.patch.object(agent.manager, 'LbaasAgentManager') - ) as (mock_launch, mock_eventlet, sys_argv, mgr_cls): + ) as (mock_logging, mock_launch, mock_eventlet, sys_argv, mgr_cls): agent.main() self.assertTrue(mock_eventlet.monkey_patch.called)