Skip to content

Commit 0bd2d96

Browse files
committed
Add test for dictionary
1 parent 04e9274 commit 0bd2d96

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_igzip_lib.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ def test_failure(self):
224224
with pytest.raises(Exception):
225225
igzd.decompress(self.BAD_DATA * 30)
226226

227+
def test_dictionary(self):
228+
compressor = zlib.compressobj(zdict=b"bla")
229+
data = compressor.compress(b"bladiebla") + compressor.flush()
230+
igzd = IgzipDecompressor(flag=DECOMP_ZLIB, zdict=b"bla")
231+
assert igzd.decompress(data) == b"bladiebla"
232+
227233

228234
@pytest.mark.parametrize("test_offset", range(5))
229235
def test_igzip_decompressor_raw_deflate_unused_data_zlib(test_offset):

0 commit comments

Comments
 (0)