mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-04-11 22:00:19 +00:00
Fix test failuar.
This commit is contained in:
parent
54916f79a5
commit
6b78223231
1 changed files with 6 additions and 4 deletions
|
|
@ -5,19 +5,21 @@ from nose.tools import *
|
|||
import six
|
||||
from msgpack import Unpacker, packb
|
||||
|
||||
|
||||
def test_write_bytes():
|
||||
unpacker = Unpacker()
|
||||
unpacker.feed(b'abc')
|
||||
f = six.BytesIO()
|
||||
assert_equal(unpacker.unpack(f.write), ord('a'))
|
||||
assert_equal(f.getvalue(), b'a')
|
||||
f.truncate(0)
|
||||
assert_is_none(unpacker.skip(f.write))
|
||||
f = six.BytesIO()
|
||||
assert unpacker.skip(f.write) is None
|
||||
assert_equal(f.getvalue(), b'b')
|
||||
f.truncate(0)
|
||||
assert_is_none(unpacker.skip())
|
||||
f = six.BytesIO()
|
||||
assert unpacker.skip() is None
|
||||
assert_equal(f.getvalue(), b'')
|
||||
|
||||
|
||||
def test_write_bytes_multi_buffer():
|
||||
long_val = (5) * 100
|
||||
expected = packb(long_val)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue