summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorINADA Naoki <inada-n@klab.com>2014-02-17 04:07:16 +0900
committerINADA Naoki <inada-n@klab.com>2014-02-17 04:07:16 +0900
commiteb3537ab5090c06dc64931bd3901c955330da901 (patch)
tree985ebc96505ea8f73bd1170e085e882aac2bc1a3 /test
parentff263dfee81b3c20de8e75f903a9ef82ba9e7de2 (diff)
parent518f886b111808d7d9f29b34c50baddb01610338 (diff)
downloadmsgpack-python-eb3537ab5090c06dc64931bd3901c955330da901.tar.gz
Merge branch 'pr/82'
Diffstat (limited to 'test')
-rw-r--r--test/test_buffer.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_buffer.py b/test/test_buffer.py
index 04cc02d..6cb2295 100644
--- a/test/test_buffer.py
+++ b/test/test_buffer.py
@@ -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)