From e9ee8c90b5d4f6238c16931805362222a078a701 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 22 Nov 2013 13:41:32 +0900 Subject: [PATCH] test_lldp: stop abusing Packet.next() Signed-off-by: YAMAMOTO Takashi Signed-off-by: FUJITA Tomonori --- ryu/tests/unit/packet/test_lldp.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ryu/tests/unit/packet/test_lldp.py b/ryu/tests/unit/packet/test_lldp.py index 60e93b00..6013137e 100644 --- a/ryu/tests/unit/packet/test_lldp.py +++ b/ryu/tests/unit/packet/test_lldp.py @@ -71,9 +71,10 @@ class TestLLDPMandatoryTLV(unittest.TestCase): def test_parse(self): buf = self.data pkt = packet.Packet(buf) + i = iter(pkt) - eq_(type(pkt.next()), ethernet.ethernet) - eq_(type(pkt.next()), lldp.lldp) + eq_(type(i.next()), ethernet.ethernet) + eq_(type(i.next()), lldp.lldp) def test_tlv(self): tlv = lldp.ChassisID(subtype=lldp.ChassisID.SUB_MAC_ADDRESS, @@ -225,9 +226,10 @@ class TestLLDPOptionalTLV(unittest.TestCase): def test_parse(self): buf = self.data pkt = packet.Packet(buf) + i = iter(pkt) - eq_(type(pkt.next()), ethernet.ethernet) - lldp_pkt = pkt.next() + eq_(type(i.next()), ethernet.ethernet) + lldp_pkt = i.next() eq_(type(lldp_pkt), lldp.lldp) tlvs = lldp_pkt.tlvs