mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-19 20:03:16 +00:00
fixed support of python3
This commit is contained in:
parent
48ca2d700d
commit
11a3b1561a
2 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue