Merge branch 'pr/82'

This commit is contained in:
INADA Naoki 2014-02-17 04:07:16 +09:00
commit eb3537ab50
2 changed files with 11 additions and 1 deletions

View file

@ -2,12 +2,20 @@
# coding: utf-8
from msgpack import packb, unpackb
import sys
def test_unpack_buffer():
from array import array
buf = array('b')
buf.fromstring(packb(('foo', 'bar')))
buf.fromstring(packb((b'foo', b'bar')))
obj = unpackb(buf, use_list=1)
assert [b'foo', b'bar'] == obj
def test_unpack_bytearray():
buf = bytearray(packb(('foo', 'bar')))
obj = unpackb(buf, use_list=1)
assert [b'foo', b'bar'] == obj
expected_type = bytes
assert all(type(s) == expected_type for s in obj)