Skip to content

Commit 000c141

Browse files
committed
Add tests for igzip reader
1 parent d8ff261 commit 000c141

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_igzip.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ def test_write_readonly_file():
5050
error.match(r"write\(\) on read-only IGzipFile object")
5151

5252

53+
def test_igzip_reader_readall():
54+
data = io.BytesIO(COMPRESSED_DATA)
55+
test = igzip._IGzipReader(data)
56+
assert test.read(-1) == DATA
57+
58+
59+
def test_igzip_reader_read_zero():
60+
data = io.BytesIO(COMPRESSED_DATA)
61+
test = igzip._IGzipReader(data)
62+
assert test.read(0) == b""
63+
64+
5365
@pytest.mark.parametrize("level", range(1, 10))
5466
def test_decompress_stdin_stdout(capsysbinary, level):
5567
"""Test if the command line can decompress data that has been compressed

0 commit comments

Comments
 (0)