From 34008eb55409d6ff2732da045246a84f144044c4 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 10 Mar 2015 10:23:53 +0900 Subject: [PATCH] linuxbridge UT: Do not create the same instance in each cases Reuse the one created by setUp() instead. Related-Bug: #1430098 Change-Id: I2cf1123c66a81ad967507a2fefb89c306cdb28bb --- neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py b/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py index b32a03cb8d6..9fb816ec177 100644 --- a/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py +++ b/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py @@ -108,7 +108,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): 0) def test_treat_devices_removed_with_existed_device(self): - agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC({}, 0) + agent = self.agent devices = [DEVICE_1] with contextlib.nested( mock.patch.object(agent.plugin_rpc, "update_device_down"), @@ -125,7 +125,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): self.assertTrue(fn_rdf.called) def test_treat_devices_removed_with_not_existed_device(self): - agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC({}, 0) + agent = self.agent devices = [DEVICE_1] with contextlib.nested( mock.patch.object(agent.plugin_rpc, "update_device_down"), @@ -142,7 +142,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): self.assertTrue(fn_rdf.called) def test_treat_devices_removed_failed(self): - agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC({}, 0) + agent = self.agent devices = [DEVICE_1] with contextlib.nested( mock.patch.object(agent.plugin_rpc, "update_device_down"),