diff options
author | INADA Naoki <songofacandy@gmail.com> | 2010-10-26 01:49:00 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2010-10-26 01:49:00 +0900 |
commit | 0076d42a0ddeb3601f1a0c806c7874da2110a986 (patch) | |
tree | d6fe47f2273a8c527796fe81c67f8610e71a72b2 /test/test_obj.py | |
parent | 3980d381f7ad44b14483dc90c0f6f0a36804c290 (diff) | |
download | msgpack-python-0076d42a0ddeb3601f1a0c806c7874da2110a986.tar.gz |
Add check for recursion limit and default hook result.
Diffstat (limited to 'test/test_obj.py')
-rw-r--r-- | test/test_obj.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test_obj.py b/test/test_obj.py index 64a6390..28edacb 100644 --- a/test/test_obj.py +++ b/test/test_obj.py @@ -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() |