mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-04-14 06:50:20 +00:00
Fixed encoding argument for unpacker in Python
This commit is contained in:
parent
4a1ce19add
commit
8c3c8a250b
3 changed files with 34 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue