diff options
| author | INADA Naoki <inada-n@klab.com> | 2013-01-29 15:12:04 +0900 |
|---|---|---|
| committer | INADA Naoki <inada-n@klab.com> | 2013-01-29 15:12:04 +0900 |
| commit | 86983e27bc809bd2f25a0ad61ffacb978b1c1ad9 (patch) | |
| tree | 24c0a910ad8f4bf328a95a532e14591bdd672636 /test | |
| parent | 5f55e4c6dbc3ec723bea5b9fead2e36224e70b81 (diff) | |
| parent | 8d6a387dff10dd2150aa86cd96e2bece26546268 (diff) | |
| download | msgpack-python-86983e27bc809bd2f25a0ad61ffacb978b1c1ad9.tar.gz | |
Add purepython fallback. (Merge branch 'purepython')
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_sequnpack.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_sequnpack.py b/test/test_sequnpack.py index fc1f712..9db14ca 100644 --- a/test/test_sequnpack.py +++ b/test/test_sequnpack.py @@ -7,6 +7,21 @@ from msgpack.exceptions import OutOfData from pytest import raises +def test_partialdata(): + unpacker = Unpacker() + unpacker.feed(b'\xa5') + with raises(StopIteration): next(iter(unpacker)) + unpacker.feed(b'h') + with raises(StopIteration): next(iter(unpacker)) + unpacker.feed(b'a') + with raises(StopIteration): next(iter(unpacker)) + unpacker.feed(b'l') + with raises(StopIteration): next(iter(unpacker)) + unpacker.feed(b'l') + with raises(StopIteration): next(iter(unpacker)) + unpacker.feed(b'o') + assert next(iter(unpacker)) == b'hallo' + def test_foobar(): unpacker = Unpacker(read_size=3, use_list=1) unpacker.feed(b'foobar') |
