From 26b4c5606c579e26e896c409b7b18320e00c39d7 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 24 May 2017 15:32:54 -0700 Subject: [PATCH] python3: convert range object to list before comparing with a list In python3, calling range() doesn't produce a list, but an iterable. We need to explicitly convert it to a list, otherwise we get an error: MismatchError: range(5, 16) != [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] Change-Id: Ie55c0d0a98a2b81c237ef42a55f7ce4b129828fb --- neutron/tests/functional/agent/test_firewall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/tests/functional/agent/test_firewall.py b/neutron/tests/functional/agent/test_firewall.py index 535b6710917..349d54eca25 100644 --- a/neutron/tests/functional/agent/test_firewall.py +++ b/neutron/tests/functional/agent/test_firewall.py @@ -277,7 +277,7 @@ class FirewallTestCase(BaseFirewallTestCase): (outgoing_rule_pref, i['port_range_min'])) for i in sg_rules] # all indexes should be in order with no unexpected rules in between - self.assertEqual(range(indexes[0], indexes[-1] + 1), indexes) + self.assertEqual(list(range(indexes[0], indexes[-1] + 1)), indexes) def test_ingress_icmp_secgroup(self): # update the sg_group to make ping pass