fixed support of python3

This commit is contained in:
Sergey Zhuravlev 2014-02-12 23:09:23 +04:00
parent 48ca2d700d
commit 11a3b1561a
2 changed files with 5 additions and 2 deletions

View file

@ -2,6 +2,7 @@
# coding: utf-8
from msgpack import packb, unpackb
import sys
def test_unpack_buffer():
@ -16,5 +17,7 @@ def test_unpack_bytearray():
buf = bytearray(packb(('foo', 'bar')))
obj = unpackb(buf, use_list=1)
assert [b'foo', b'bar'] == obj
assert all(type(s)==str for s in obj)
expected_type = bytes if sys.version_info[0] == 3 else str
assert all(type(s)==expected_type for s in obj)