Fix tests to pass.

This commit is contained in:
INADA Naoki 2012-06-19 14:20:56 +09:00
parent 0b38e86534
commit 636f4529aa
4 changed files with 26 additions and 24 deletions

View file

@ -1,8 +1,6 @@
#!/usr/bin/env python
# coding: utf-8
from msgpack import Unpacker
def test_foobar():
@ -16,18 +14,16 @@ def test_foobar():
assert unpacker.unpack() == ord(b'r')
try:
o = unpacker.unpack()
print(("Oops!", o))
assert 0
assert 0, "should raise exception"
except StopIteration:
assert 1
else:
assert 0
assert 1, "ok"
unpacker.feed(b'foo')
unpacker.feed(b'bar')
k = 0
for o, e in zip(unpacker, b'foobarbaz'):
assert o == e
for o, e in zip(unpacker, 'foobarbaz'):
assert o == ord(e)
k += 1
assert k == len(b'foobar')