diff options
Diffstat (limited to 'test/test_obj.py')
-rw-r--r-- | test/test_obj.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_obj.py b/test/test_obj.py index d155b73..d809093 100644 --- a/test/test_obj.py +++ b/test/test_obj.py @@ -18,25 +18,25 @@ def _encode_complex(obj): def test_encode_hook(): packed = packb([3, 1+2j], default=_encode_complex) - unpacked = unpackb(packed) + unpacked = unpackb(packed, use_list=1) eq_(unpacked[1], {b'__complex__': True, b'real': 1, b'imag': 2}) def test_decode_hook(): packed = packb([3, {b'__complex__': True, b'real': 1, b'imag': 2}]) - unpacked = unpackb(packed, object_hook=_decode_complex) + unpacked = unpackb(packed, object_hook=_decode_complex, use_list=1) eq_(unpacked[1], 1+2j) @raises(ValueError) def test_bad_hook(): packed = packb([3, 1+2j], default=lambda o: o) - unpacked = unpackb(packed) + unpacked = unpackb(packed, use_list=1) def _arr_to_str(arr): return ''.join(str(c) for c in arr) def test_array_hook(): packed = packb([1,2,3]) - unpacked = unpackb(packed, list_hook=_arr_to_str) + unpacked = unpackb(packed, list_hook=_arr_to_str, use_list=1) eq_(unpacked, '123') if __name__ == '__main__': |