summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexei Romanoff <drednout.by@gmail.com>2012-10-12 13:19:53 +0300
committerAlexei Romanoff <drednout.by@gmail.com>2012-10-12 13:19:53 +0300
commitcf89f18be7614d6d55bb9eb7e9bf0e10d42a8508 (patch)
treee8896d1a6e740edd28551c6f0320f356b58c512e /test
parent4ea952f39dc5ff1231f780252d8d4efb16b2be3b (diff)
downloadmsgpack-python-cf89f18be7614d6d55bb9eb7e9bf0e10d42a8508.tar.gz
segfault fixed when data is unpacked using `list_hook`,
this bug is a twin to #28. Unit-test is also attached.
Diffstat (limited to 'test')
-rw-r--r--test/test_obj.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_obj.py b/test/test_obj.py
index 15e192c..1d9024b 100644
--- a/test/test_obj.py
+++ b/test/test_obj.py
@@ -62,5 +62,13 @@ def test_an_exception_in_objecthook1():
packed = packb({1: {'__complex__': True, 'real': 1, 'imag': 2}})
unpackb(packed, object_hook=bad_complex_decoder)
+
+@raises(DecodeError)
+def test_an_exception_in_objecthook2():
+ packed = packb({1: [{'__complex__': True, 'real': 1, 'imag': 2}]})
+ unpackb(packed, list_hook=bad_complex_decoder, use_list=1)
+
+
+
if __name__ == '__main__':
main()