diff options
Diffstat (limited to 'Lib/test/test_gzip.py')
| -rw-r--r-- | Lib/test/test_gzip.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index a8354a93d6..a82c56e0e6 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -289,23 +289,6 @@ class TestGzip(unittest.TestCase): with gzip.GzipFile(fileobj=f, mode="w") as g: self.assertEqual(g.name, "") - def test_read_truncated(self): - data = data1*50 - buf = io.BytesIO() - with gzip.GzipFile(fileobj=buf, mode="w") as f: - f.write(data) - # Drop the CRC (4 bytes) and file size (4 bytes). - truncated = buf.getvalue()[:-8] - with gzip.GzipFile(fileobj=io.BytesIO(truncated)) as f: - self.assertRaises(EOFError, f.read) - with gzip.GzipFile(fileobj=io.BytesIO(truncated)) as f: - self.assertEqual(f.read(len(data)), data) - self.assertRaises(EOFError, f.read, 1) - # Incomplete 10-byte header. - for i in range(2, 10): - with gzip.GzipFile(fileobj=io.BytesIO(truncated[:i])) as f: - self.assertRaises(EOFError, f.read, 1) - def test_read_with_extra(self): # Gzip data with an extra field gzdata = (b'\x1f\x8b\x08\x04\xb2\x17cQ\x02\xff' |
