Skip to content
Next Next commit
Add test for zlib.compress wbits
  • Loading branch information
rhpvorderman committed Mar 24, 2021
commit 2c600de3cd196f71e9a84bf7f544ef5897f2652f
6 changes: 6 additions & 0 deletions Lib/test/test_zlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,12 @@ def test_wbits(self):
dco = zlib.decompressobj(32 + 15)
self.assertEqual(dco.decompress(gzip), HAMLET_SCENE)

for wbits in (-15, 15, 31):
self.assertEqual(
zlib.decompress(
zlib.compress(HAMLET_SCENE, wbits=wbits), wbits=wbits
), HAMLET_SCENE)


def choose_lines(source, number, seed=None, generator=random):
"""Return a list of number lines randomly chosen from the source"""
Expand Down