summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-01-12 19:22:36 +0900
committerGitHub <noreply@github.com>2018-01-12 19:22:36 +0900
commit5569a4efcdc913d343eaff4e55c9b19fafde4268 (patch)
tree0c05339319e6f63d06eec2056fa23ccd0d8a3050 /test
parentd9ec8fc905fc9ed37c86700f794adeb883b4f5ea (diff)
downloadmsgpack-python-5569a4efcdc913d343eaff4e55c9b19fafde4268.tar.gz
s/raw_as_bytes/raw/g (#276)
fixes #273
Diffstat (limited to 'test')
-rw-r--r--test/test_limits.py4
-rw-r--r--test/test_pack.py8
-rw-r--r--test/test_stricttype.py8
-rw-r--r--test/test_unpack.py2
4 files changed, 11 insertions, 11 deletions
diff --git a/test/test_limits.py b/test/test_limits.py
index 3febc30..74e48c1 100644
--- a/test/test_limits.py
+++ b/test/test_limits.py
@@ -39,11 +39,11 @@ def test_max_str_len():
d = 'x' * 3
packed = packb(d)
- unpacker = Unpacker(max_str_len=3, raw_as_bytes=False)
+ unpacker = Unpacker(max_str_len=3, raw=False)
unpacker.feed(packed)
assert unpacker.unpack() == d
- unpacker = Unpacker(max_str_len=2, raw_as_bytes=False)
+ unpacker = Unpacker(max_str_len=2, raw=False)
with pytest.raises(UnpackValueError):
unpacker.feed(packed)
unpacker.unpack()
diff --git a/test/test_pack.py b/test/test_pack.py
index 29f5887..b447f9c 100644
--- a/test/test_pack.py
+++ b/test/test_pack.py
@@ -31,11 +31,11 @@ def testPack():
def testPackUnicode():
test_data = ["", "abcd", ["defgh"], "Русский текст"]
for td in test_data:
- re = unpackb(packb(td), use_list=1, raw_as_bytes=False)
+ re = unpackb(packb(td), use_list=1, raw=False)
assert re == td
packer = Packer()
data = packer.pack(td)
- re = Unpacker(BytesIO(data), raw_as_bytes=False, use_list=1).unpack()
+ re = Unpacker(BytesIO(data), raw=False, use_list=1).unpack()
assert re == td
def testPackUTF32(): # deprecated
@@ -72,14 +72,14 @@ def testIgnoreUnicodeErrors(): # deprecated
def testStrictUnicodeUnpack():
with raises(UnicodeDecodeError):
- unpackb(packb(b'abc\xeddef'), raw_as_bytes=False, use_list=1)
+ unpackb(packb(b'abc\xeddef'), raw=False, use_list=1)
def testStrictUnicodePack(): # deprecated
with raises(UnicodeEncodeError):
packb("abc\xeddef", encoding='ascii', unicode_errors='strict')
def testIgnoreErrorsPack(): # deprecated
- re = unpackb(packb("abcФФФdef", encoding='ascii', unicode_errors='ignore'), raw_as_bytes=False, use_list=1)
+ re = unpackb(packb("abcФФФdef", encoding='ascii', unicode_errors='ignore'), raw=False, use_list=1)
assert re == "abcdef"
def testDecodeBinary():
diff --git a/test/test_stricttype.py b/test/test_stricttype.py
index 13239f1..87e7c1c 100644
--- a/test/test_stricttype.py
+++ b/test/test_stricttype.py
@@ -11,7 +11,7 @@ def test_namedtuple():
return dict(o._asdict())
raise TypeError('Unsupported type %s' % (type(o),))
packed = packb(T(1, 42), strict_types=True, use_bin_type=True, default=default)
- unpacked = unpackb(packed, raw_as_bytes=False)
+ unpacked = unpackb(packed, raw=False)
assert unpacked == {'foo': 1, 'bar': 42}
@@ -32,7 +32,7 @@ def test_tuple():
return o
data = packb(t, strict_types=True, use_bin_type=True, default=default)
- expected = unpackb(data, raw_as_bytes=False, object_hook=convert)
+ expected = unpackb(data, raw=False, object_hook=convert)
assert expected == t
@@ -53,10 +53,10 @@ def test_tuple_ext():
def convert(code, payload):
if code == MSGPACK_EXT_TYPE_TUPLE:
# Unpack and convert to tuple
- return tuple(unpackb(payload, raw_as_bytes=False, ext_hook=convert))
+ return tuple(unpackb(payload, raw=False, ext_hook=convert))
raise ValueError('Unknown Ext code {}'.format(code))
data = packb(t, strict_types=True, use_bin_type=True, default=default)
- expected = unpackb(data, raw_as_bytes=False, ext_hook=convert)
+ expected = unpackb(data, raw=False, ext_hook=convert)
assert expected == t
diff --git a/test/test_unpack.py b/test/test_unpack.py
index 143f999..00a1061 100644
--- a/test/test_unpack.py
+++ b/test/test_unpack.py
@@ -48,7 +48,7 @@ def test_unpacker_ext_hook():
def __init__(self):
super(MyUnpacker, self).__init__(
- ext_hook=self._hook, raw_as_bytes=False)
+ ext_hook=self._hook, raw=False)
def _hook(self, code, data):
if code == 1: