summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gzip.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-11-21 10:57:15 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2015-11-21 10:57:15 (GMT)
commit36befa5b4c37b34de9c7f59eba26575b255114cf (patch)
treed87a8cd77c6bbdfeb0e15a8320740da4051ab786 /Lib/test/test_gzip.py
parent266b276f34db5cc106d100f63b631af1f1f8e0e2 (diff)
parente99e97762cc75ad94056275ddcae9c84d63a3412 (diff)
downloadcpython-36befa5b4c37b34de9c7f59eba26575b255114cf.zip
cpython-36befa5b4c37b34de9c7f59eba26575b255114cf.tar.gz
cpython-36befa5b4c37b34de9c7f59eba26575b255114cf.tar.bz2
Issue #25626: Merge zlib fix from 3.5
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r--Lib/test/test_gzip.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index d8408e1..3c51673 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -3,6 +3,7 @@
import unittest
from test import support
+from test.support import bigmemtest, _4G
import os
import io
import struct
@@ -116,6 +117,14 @@ class TestGzip(BaseTest):
self.assertEqual(f.tell(), nread)
self.assertEqual(b''.join(blocks), data1 * 50)
+ @bigmemtest(size=_4G, memuse=1)
+ def test_read_large(self, size):
+ # Read chunk size over UINT_MAX should be supported, despite zlib's
+ # limitation per low-level call
+ compressed = gzip.compress(data1, compresslevel=1)
+ f = gzip.GzipFile(fileobj=io.BytesIO(compressed), mode='rb')
+ self.assertEqual(f.read(size), data1)
+
def test_io_on_closed_object(self):
# Test that I/O operations on closed GzipFile objects raise a
# ValueError, just like the corresponding functions on file objects.