summaryrefslogtreecommitdiff
path: root/test/test_pack.py
diff options
context:
space:
mode:
authorjfolz <theriddling@gmail.com>2017-05-18 13:03:15 +0200
committerINADA Naoki <methane@users.noreply.github.com>2017-05-18 20:03:15 +0900
commitf0f2c0b39703e0129d2352c71ec9811a8f275cc8 (patch)
tree927b079e6be25fe7db2e7108b75efdd1a79c1692 /test/test_pack.py
parenta8d9162ca6cff6101c1f6b9547e94749c6acae96 (diff)
downloadmsgpack-python-f0f2c0b39703e0129d2352c71ec9811a8f275cc8.tar.gz
Packer accepts bytearray objects (#229)
Diffstat (limited to 'test/test_pack.py')
-rw-r--r--test/test_pack.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_pack.py b/test/test_pack.py
index e945902..a704fdb 100644
--- a/test/test_pack.py
+++ b/test/test_pack.py
@@ -58,6 +58,13 @@ def testPackBytes():
for td in test_data:
check(td)
+def testPackByteArrays():
+ test_data = [
+ bytearray(b""), bytearray(b"abcd"), (bytearray(b"defgh"),),
+ ]
+ for td in test_data:
+ check(td)
+
def testIgnoreUnicodeErrors():
re = unpackb(packb(b'abc\xeddef'), encoding='utf-8', unicode_errors='ignore', use_list=1)
assert re == "abcdef"