diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-12-05 21:34:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 21:34:10 +0900 |
commit | 7e9905bdfaecde83ddb1a4575e734a10b055fde9 (patch) | |
tree | 2b9900fcdf0b5b1986b024edb2802971399b8fb8 /test/test_case.py | |
parent | de320488ae494b85a03b60dd33f91b650033d775 (diff) | |
download | msgpack-python-7e9905bdfaecde83ddb1a4575e734a10b055fde9.tar.gz |
Use new msgpack spec by default. (#386)
Diffstat (limited to 'test/test_case.py')
-rw-r--r-- | test/test_case.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/test_case.py b/test/test_case.py index 3bc1b26..3e60e59 100644 --- a/test/test_case.py +++ b/test/test_case.py @@ -1,13 +1,12 @@ #!/usr/bin/env python # coding: utf-8 - from msgpack import packb, unpackb -def check(length, obj): - v = packb(obj) +def check(length, obj, use_bin_type=True): + v = packb(obj, use_bin_type=use_bin_type) assert len(v) == length, "%r length should be %r but get %r" % (obj, length, len(v)) - assert unpackb(v, use_list=0) == obj + assert unpackb(v, use_list=0, raw=not use_bin_type) == obj def test_1(): @@ -56,7 +55,7 @@ def test_9(): def check_raw(overhead, num): - check(num + overhead, b" " * num) + check(num + overhead, b" " * num, use_bin_type=False) def test_fixraw(): @@ -135,4 +134,4 @@ def test_match(): def test_unicode(): - assert unpackb(packb("foobar"), use_list=1) == b"foobar" + assert unpackb(packb(u"foobar"), use_list=1) == u"foobar" |