We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e846fe3 commit a73fc73Copy full SHA for a73fc73
Lib/test/test_gzip.py
@@ -552,6 +552,15 @@ def test_compress_mtime(self):
552
f.read(1) # to set mtime attribute
553
self.assertEqual(f.mtime, mtime)
554
555
+ def test_compress_correct_level(self):
556
+ # gzip.compress calls with mtime == 0 take a different code path.
557
+ for mtime in (0, 42):
558
+ with self.subTest(mtime=mtime):
559
+ nocompress = gzip.compress(data1, compresslevel=0, mtime=mtime)
560
+ yescompress = gzip.compress(data1, compresslevel=1, mtime=mtime)
561
+ self.assertIn(data1, nocompress)
562
+ self.assertNotIn(data1, yescompress)
563
+
564
def test_decompress(self):
565
for data in (data1, data2):
566
buf = io.BytesIO()
0 commit comments