Skip to content

Commit

Permalink
Fix to unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldmccarthy committed Oct 3, 2017
1 parent 9b51814 commit 77590f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions indexed_gzip/tests/ctest_indexed_gzip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,12 @@ def test_readinto():
buf = bytearray(len(lines[-1]) + 10)
f.seek(offset)
assert f.readinto(buf) == len(lines[-1]) + 1
print(buf.decode())
assert buf.decode() == lines[-1] + '\n' + (b'\0' * 9).decode()

# start at EOF, and try to read something
filelen = sum([len(l) for l in lines]) + len(lines)
f.seek(filelen)
buf = bytearray([chr(99) for i in range(len(buf))])
buf = bytearray([99 for i in range(len(buf))])
assert f.readinto(buf) == 0
assert all([b == chr(99) for b in buf.decode()])

Expand Down

0 comments on commit 77590f7

Please sign in to comment.