Fix i386 test failures

Signed-off-by: Corey Bryant <corey.bryant@canonical.com>
Reviewed-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Corey Bryant 2016-02-16 10:37:57 -05:00 committed by FUJITA Tomonori
parent 5552348c7c
commit 27409a544e
3 changed files with 4 additions and 4 deletions

View File

@ -170,7 +170,7 @@ class MsgBase(StringifyMixin):
def __str__(self): def __str__(self):
def hexify(x): def hexify(x):
return hex(x) if isinstance(x, int) else x return hex(x) if isinstance(x, six.integer_types) else x
buf = 'version=%s,msg_type=%s,msg_len=%s,xid=%s,' %\ buf = 'version=%s,msg_type=%s,msg_len=%s,xid=%s,' %\
(hexify(self.version), hexify(self.msg_type), (hexify(self.version), hexify(self.msg_type),
hexify(self.msg_len), hexify(self.xid)) hexify(self.msg_len), hexify(self.xid))

View File

@ -82,7 +82,7 @@ def _get_field_info_by_number(oxx, num_to_field, n):
name = f.name name = f.name
except KeyError: except KeyError:
t = type_desc.UnknownType t = type_desc.UnknownType
if isinstance(n, int): if isinstance(n, six.integer_types):
name = 'field_%d' % (n,) name = 'field_%d' % (n,)
else: else:
raise KeyError('unknown %s field number: %s' % (oxx.upper(), n)) raise KeyError('unknown %s field number: %s' % (oxx.upper(), n))

View File

@ -697,7 +697,7 @@ class TestPacket(unittest.TestCase):
sctp_values = {'src_port': 1, sctp_values = {'src_port': 1,
'dst_port': 1, 'dst_port': 1,
'vtag': 0, 'vtag': 0,
'csum': p_sctp.csum, 'csum': repr(p_sctp.csum),
'chunks': data_str} 'chunks': data_str}
_sctp_str = ','.join(['%s=%s' % (k, sctp_values[k]) _sctp_str = ','.join(['%s=%s' % (k, sctp_values[k])
for k, _ in inspect.getmembers(p_sctp) for k, _ in inspect.getmembers(p_sctp)
@ -1233,7 +1233,7 @@ class TestPacket(unittest.TestCase):
sctp_values = {'src_port': 1, sctp_values = {'src_port': 1,
'dst_port': 1, 'dst_port': 1,
'vtag': 0, 'vtag': 0,
'csum': p_sctp.csum, 'csum': repr(p_sctp.csum),
'chunks': data_str} 'chunks': data_str}
_sctp_str = ','.join(['%s=%s' % (k, sctp_values[k]) _sctp_str = ','.join(['%s=%s' % (k, sctp_values[k])
for k, _ in inspect.getmembers(p_sctp) for k, _ in inspect.getmembers(p_sctp)