Decompressed data buffering should be limited
(self)
| 1076 | self.assertListEqual(f.readlines(), lines) |
| 1077 | |
| 1078 | def test_decompress_limited(self): |
| 1079 | """Decompressed data buffering should be limited""" |
| 1080 | bomb = lzma.compress(b'\0' * int(2e6), preset=6) |
| 1081 | self.assertLess(len(bomb), _streams.BUFFER_SIZE) |
| 1082 | |
| 1083 | decomp = LZMAFile(BytesIO(bomb)) |
| 1084 | self.assertEqual(decomp.read(1), b'\0') |
| 1085 | max_decomp = 1 + DEFAULT_BUFFER_SIZE |
| 1086 | self.assertLessEqual(decomp._buffer.raw.tell(), max_decomp, |
| 1087 | "Excessive amount of data was decompressed") |
| 1088 | |
| 1089 | def test_write(self): |
| 1090 | with BytesIO() as dst: |
nothing calls this directly
no test coverage detected