mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-19 20:03:16 +00:00
Packer accepts bytearray objects (#229)
This commit is contained in:
parent
a8d9162ca6
commit
f0f2c0b397
3 changed files with 23 additions and 4 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue