linuxbridge UT: Do not create the same instance in each cases

Reuse the one created by setUp() instead.

Related-Bug: #1430098
Change-Id: I2cf1123c66a81ad967507a2fefb89c306cdb28bb
This commit is contained in:
YAMAMOTO Takashi 2015-03-10 10:23:53 +09:00
parent 140ce6ce95
commit 34008eb554
1 changed files with 3 additions and 3 deletions

View File

@ -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"),