From f0f2c0b39703e0129d2352c71ec9811a8f275cc8 Mon Sep 17 00:00:00 2001 From: jfolz Date: Thu, 18 May 2017 13:03:15 +0200 Subject: Packer accepts bytearray objects (#229) --- test/test_pack.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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" -- cgit v1.2.1