summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test_pack.py6
-rw-r--r--test/test_read_size.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/test/test_pack.py b/test/test_pack.py
index ff1eeef..21c2bd7 100644
--- a/test/test_pack.py
+++ b/test/test_pack.py
@@ -99,9 +99,9 @@ def testArraySize(sizes=[0, 5, 50, 1000]):
bio.write(packer.pack(i))
bio.seek(0)
- unpacker = Unpacker(bio)
+ unpacker = Unpacker(bio, use_list=1)
for size in sizes:
- assert unpacker.unpack() == tuple(range(size))
+ assert unpacker.unpack() == list(range(size))
def testMapSize(sizes=[0, 5, 50, 1000]):
bio = six.BytesIO()
@@ -115,7 +115,7 @@ def testMapSize(sizes=[0, 5, 50, 1000]):
bio.seek(0)
unpacker = Unpacker(bio)
for size in sizes:
- assert unpacker.unpack() == {i: i * 2 for i in range(size)}
+ assert unpacker.unpack() == dict((i, i * 2) for i in range(size))
diff --git a/test/test_read_size.py b/test/test_read_size.py
index 714f963..e130805 100644
--- a/test/test_read_size.py
+++ b/test/test_read_size.py
@@ -6,9 +6,9 @@ def test_read_array_header():
unpacker = Unpacker()
unpacker.feed(packb(['a', 'b', 'c']))
assert unpacker.read_array_header() == 3
- assert unpacker.unpack() == 'a'
- assert unpacker.unpack() == 'b'
- assert unpacker.unpack() == 'c'
+ assert unpacker.unpack() == b'a'
+ assert unpacker.unpack() == b'b'
+ assert unpacker.unpack() == b'c'
try:
unpacker.unpack()
assert 0, 'should raise exception'
@@ -20,8 +20,8 @@ def test_read_map_header():
unpacker = Unpacker()
unpacker.feed(packb({'a': 'A'}))
assert unpacker.read_map_header() == 1
- assert unpacker.unpack() == 'a'
- assert unpacker.unpack() == 'A'
+ assert unpacker.unpack() == B'a'
+ assert unpacker.unpack() == B'A'
try:
unpacker.unpack()
assert 0, 'should raise exception'