diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2013-11-22 13:41:32 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-11-22 11:38:12 -0800 |
commit | e9ee8c90b5d4f6238c16931805362222a078a701 (patch) | |
tree | 414aa6376d432239dfa5be834cff62d0e16f1d06 | |
parent | afcdb5f123f0c9980ba298885a992f334f50e0c5 (diff) |
test_lldp: stop abusing Packet.next()
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/unit/packet/test_lldp.py | 10 |
1 files 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 |