mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-19 20:03:16 +00:00
Add raw_as_bytes option to Unpacker. (#265)
This commit is contained in:
parent
50ea49c86f
commit
5534d0c7af
11 changed files with 199 additions and 93 deletions
|
@ -39,11 +39,11 @@ def test_max_str_len():
|
|||
d = 'x' * 3
|
||||
packed = packb(d)
|
||||
|
||||
unpacker = Unpacker(max_str_len=3, encoding='utf-8')
|
||||
unpacker = Unpacker(max_str_len=3, raw_as_bytes=False)
|
||||
unpacker.feed(packed)
|
||||
assert unpacker.unpack() == d
|
||||
|
||||
unpacker = Unpacker(max_str_len=2, encoding='utf-8')
|
||||
unpacker = Unpacker(max_str_len=2, raw_as_bytes=False)
|
||||
with pytest.raises(UnpackValueError):
|
||||
unpacker.feed(packed)
|
||||
unpacker.unpack()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue