From 5e5f74180c264d3bae2be1cf62ae89ab656c2dd7 Mon Sep 17 00:00:00 2001 From: Jakub Libosvar Date: Tue, 6 Jan 2015 23:21:57 +0100 Subject: [PATCH] Fix UT for L2pop test_get_agent_ports_no_data() Previously loop in this test has never been executed because returned generator was empty. This patch validates that generator is empty. Change-Id: I900cd7bccee16487ab5469a2222afd294d9dee25 Closes-Bug: #1365388 --- neutron/tests/unit/agent/test_l2population_rpc.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/neutron/tests/unit/agent/test_l2population_rpc.py b/neutron/tests/unit/agent/test_l2population_rpc.py index b0b8f7e49..282d5c4fb 100644 --- a/neutron/tests/unit/agent/test_l2population_rpc.py +++ b/neutron/tests/unit/agent/test_l2population_rpc.py @@ -26,10 +26,8 @@ class TestL2populationRpcCallBackTunnelMixin( l2population_rpc_base.TestL2populationRpcCallBackTunnelMixinBase): def test_get_agent_ports_no_data(self): - for lvm, agent_ports in self.fakeagent.get_agent_ports( - self.fdb_entries1, {}): - self.assertIsNone(lvm) - self.assertEqual({}, agent_ports) + self.assertFalse( + list(self.fakeagent.get_agent_ports(self.fdb_entries1, {}))) def test_get_agent_ports_non_existence_key_in_lvm(self): results = {} -- 2.45.2