aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_zlib.py
diff options
context:
space:
mode:
authorRuben Vorderman <r.h.p.vorderman@lumc.nl>2021-09-02 17:02:59 +0200
committerGitHub <noreply@github.com>2021-09-02 17:02:59 +0200
commitea23e7820f02840368569db8082bd0ca4d59b62a (patch)
tree44dcdd66cf7335a31a837d7e84a857e5c677e2b3 /Lib/test/test_zlib.py
parenta7ef15aae8608560bffeeaba412c10e52cab07dd (diff)
downloadcpython-ea23e7820f02840368569db8082bd0ca4d59b62a.tar.gz
cpython-ea23e7820f02840368569db8082bd0ca4d59b62a.zip
bpo-43613: Faster implementation of gzip.compress and gzip.decompress (GH-27941)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r--Lib/test/test_zlib.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index cb0610837ba..04fb4d93de4 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -831,6 +831,13 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
dco = zlib.decompressobj(32 + 15)
self.assertEqual(dco.decompress(gzip), HAMLET_SCENE)
+ for wbits in (-15, 15, 31):
+ with self.subTest(wbits=wbits):
+ expected = HAMLET_SCENE
+ actual = zlib.decompress(
+ zlib.compress(HAMLET_SCENE, wbits=wbits), wbits=wbits
+ )
+ self.assertEqual(expected, actual)
def choose_lines(source, number, seed=None, generator=random):
"""Return a list of number lines randomly chosen from the source"""