From 8c3c8a250b5f6f129e5e077a224ec6916cc87437 Mon Sep 17 00:00:00 2001 From: tailhook Date: Mon, 22 Aug 2011 01:52:45 +0900 Subject: Fixed `encoding` argument for unpacker in Python --- test/test_pack.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/test_pack.py b/test/test_pack.py index 2b5f1ad..357cb3c 100644 --- a/test/test_pack.py +++ b/test/test_pack.py @@ -7,6 +7,8 @@ from nose.plugins.skip import SkipTest from msgpack import packs, unpacks +from StringIO import StringIO + def check(data): re = unpacks(packs(data)) assert_equal(re, data) @@ -32,6 +34,10 @@ def testPackUnicode(): for td in test_data: re = unpacks(packs(td, encoding='utf-8'), encoding='utf-8') assert_equal(re, td) + packer = Packer(encoding='utf-8') + data = packer.pack(td) + re = Unpacker(StringIO(data), encoding='utf-8').unpack() + assert_equal(re, td) def testPackUTF32(): try: -- cgit v1.2.1