VPP-1508 python3 tests: use six.iteritems
This replaces dictionary.iteritems() on Python 2 and dictionary.items() on Python 3. Change-Id: I58a3ded7d284c59e28d484b0c285aac435bfc229 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:

committed by
Ole Trøan

parent
6e4c6ad92e
commit
f1f2aa6bf9
@ -134,7 +134,7 @@ class RemoteClass(Process):
|
||||
isinstance(val, RemoteClassAttr):
|
||||
mutable_args[i] = val.get_remote_value()
|
||||
args = tuple(mutable_args)
|
||||
for key, val in kwargs.iteritems():
|
||||
for key, val in six.iteritems(kwargs):
|
||||
if isinstance(val, RemoteClass) or \
|
||||
isinstance(val, RemoteClassAttr):
|
||||
kwargs[key] = val.get_remote_value()
|
||||
|
@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import six
|
||||
import unittest
|
||||
from random import shuffle
|
||||
|
||||
@ -77,7 +79,7 @@ class TestIPv4Reassembly(VppTestCase):
|
||||
def create_fragments(cls):
|
||||
infos = cls._packet_infos
|
||||
cls.pkt_infos = []
|
||||
for index, info in infos.iteritems():
|
||||
for index, info in six.iteritems(infos):
|
||||
p = info.data
|
||||
# cls.logger.debug(ppp("Packet:", p.__class__(str(p))))
|
||||
fragments_400 = fragment_rfc791(p, 400)
|
||||
@ -414,7 +416,7 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
def create_fragments(cls):
|
||||
infos = cls._packet_infos
|
||||
cls.pkt_infos = []
|
||||
for index, info in infos.iteritems():
|
||||
for index, info in six.iteritems(infos):
|
||||
p = info.data
|
||||
# cls.logger.debug(ppp("Packet:", p.__class__(str(p))))
|
||||
fragments_400 = fragment_rfc8200(p, info.index, 400)
|
||||
@ -805,7 +807,7 @@ class TestIPv4ReassemblyLocalNode(VppTestCase):
|
||||
def create_fragments(cls):
|
||||
infos = cls._packet_infos
|
||||
cls.pkt_infos = []
|
||||
for index, info in infos.iteritems():
|
||||
for index, info in six.iteritems(infos):
|
||||
p = info.data
|
||||
# cls.logger.debug(ppp("Packet:", p.__class__(str(p))))
|
||||
fragments_300 = fragment_rfc791(p, 300)
|
||||
@ -984,7 +986,7 @@ class TestFIFReassembly(VppTestCase):
|
||||
self.extend_packet(p, size, self.padding)
|
||||
info.data = p[IP] # use only IP part, without ethernet header
|
||||
|
||||
fragments = [x for _, p in self._packet_infos.iteritems()
|
||||
fragments = [x for _, p in six.iteritems(self._packet_infos)
|
||||
for x in fragment_rfc791(p.data, 400)]
|
||||
|
||||
encapped_fragments = \
|
||||
@ -1050,7 +1052,7 @@ class TestFIFReassembly(VppTestCase):
|
||||
self.extend_packet(p, size, self.padding)
|
||||
info.data = p[IPv6] # use only IPv6 part, without ethernet header
|
||||
|
||||
fragments = [x for _, i in self._packet_infos.iteritems()
|
||||
fragments = [x for _, i in six.iteritems(self._packet_infos)
|
||||
for x in fragment_rfc8200(
|
||||
i.data, i.index, 400)]
|
||||
|
||||
|
Reference in New Issue
Block a user