From 2122b46b8489f3cf414f5ebb137f76ecc9fd9598 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Wed, 4 Jul 2012 14:58:36 +0900 Subject: Fix using deprecated api in tests. --- test/test_obj.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/test_obj.py') diff --git a/test/test_obj.py b/test/test_obj.py index 6357cfc..d155b73 100644 --- a/test/test_obj.py +++ b/test/test_obj.py @@ -4,7 +4,7 @@ from nose import main from nose.tools import * -from msgpack import packs, unpacks +from msgpack import packb, unpackb def _decode_complex(obj): if b'__complex__' in obj: @@ -17,26 +17,26 @@ def _encode_complex(obj): return obj def test_encode_hook(): - packed = packs([3, 1+2j], default=_encode_complex) - unpacked = unpacks(packed) + packed = packb([3, 1+2j], default=_encode_complex) + unpacked = unpackb(packed) eq_(unpacked[1], {b'__complex__': True, b'real': 1, b'imag': 2}) def test_decode_hook(): - packed = packs([3, {b'__complex__': True, b'real': 1, b'imag': 2}]) - unpacked = unpacks(packed, object_hook=_decode_complex) + packed = packb([3, {b'__complex__': True, b'real': 1, b'imag': 2}]) + unpacked = unpackb(packed, object_hook=_decode_complex) eq_(unpacked[1], 1+2j) @raises(ValueError) def test_bad_hook(): - packed = packs([3, 1+2j], default=lambda o: o) - unpacked = unpacks(packed) + packed = packb([3, 1+2j], default=lambda o: o) + unpacked = unpackb(packed) def _arr_to_str(arr): return ''.join(str(c) for c in arr) def test_array_hook(): - packed = packs([1,2,3]) - unpacked = unpacks(packed, list_hook=_arr_to_str) + packed = packb([1,2,3]) + unpacked = unpackb(packed, list_hook=_arr_to_str) eq_(unpacked, '123') if __name__ == '__main__': -- cgit v1.2.1