mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-21 04:43:17 +00:00
six.BytesIO => io.BytesIO
This commit is contained in:
parent
96d7d0edc6
commit
dee2d87d41
3 changed files with 11 additions and 11 deletions
|
@ -1,19 +1,19 @@
|
|||
"""Tests for cases where the user seeks to obtain packed msgpack objects"""
|
||||
|
||||
import six
|
||||
import io
|
||||
from msgpack import Unpacker, packb
|
||||
|
||||
|
||||
def test_write_bytes():
|
||||
unpacker = Unpacker()
|
||||
unpacker.feed(b'abc')
|
||||
f = six.BytesIO()
|
||||
f = io.BytesIO()
|
||||
assert unpacker.unpack(f.write) == ord('a')
|
||||
assert f.getvalue() == b'a'
|
||||
f = six.BytesIO()
|
||||
f = io.BytesIO()
|
||||
assert unpacker.skip(f.write) is None
|
||||
assert f.getvalue() == b'b'
|
||||
f = six.BytesIO()
|
||||
f = io.BytesIO()
|
||||
assert unpacker.skip() is None
|
||||
assert f.getvalue() == b''
|
||||
|
||||
|
@ -21,9 +21,9 @@ def test_write_bytes():
|
|||
def test_write_bytes_multi_buffer():
|
||||
long_val = (5) * 100
|
||||
expected = packb(long_val)
|
||||
unpacker = Unpacker(six.BytesIO(expected), read_size=3, max_buffer_size=3)
|
||||
unpacker = Unpacker(io.BytesIO(expected), read_size=3, max_buffer_size=3)
|
||||
|
||||
f = six.BytesIO()
|
||||
f = io.BytesIO()
|
||||
unpacked = unpacker.unpack(f.write)
|
||||
assert unpacked == long_val
|
||||
assert f.getvalue() == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue