mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-12-08 06:09:49 +00:00
Add check for recursion limit and default hook result.
This commit is contained in:
parent
3980d381f7
commit
0076d42a0d
2 changed files with 17 additions and 15 deletions
|
|
@ -26,6 +26,12 @@ def test_decode_hook():
|
|||
unpacked = unpacks(packed, object_hook=_decode_complex)
|
||||
eq_(unpacked[1], 1+2j)
|
||||
|
||||
@raises(TypeError)
|
||||
def test_bad_hook():
|
||||
packed = packs([3, 1+2j], default=lambda o: o)
|
||||
unpacked = unpacks(packed)
|
||||
|
||||
if __name__ == '__main__':
|
||||
#main()
|
||||
test_decode_hook()
|
||||
test_encode_hook()
|
||||
test_bad_hook()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue