Decompressed data buffering should be limited
(self)
| 1066 | self.assertListEqual(f.readlines(), lines) |
| 1067 | |
| 1068 | def test_decompress_limited(self): |
| 1069 | """Decompressed data buffering should be limited""" |
| 1070 | bomb = lzma.compress(b'\0' * int(2e6), preset=6) |
| 1071 | self.assertLess(len(bomb), _streams.BUFFER_SIZE) |
| 1072 | |
| 1073 | decomp = LZMAFile(BytesIO(bomb)) |
| 1074 | self.assertEqual(decomp.read(1), b'\0') |
| 1075 | max_decomp = 1 + DEFAULT_BUFFER_SIZE |
| 1076 | self.assertLessEqual(decomp._buffer.raw.tell(), max_decomp, |
| 1077 | "Excessive amount of data was decompressed") |
| 1078 | |
| 1079 | def test_write(self): |
| 1080 | with BytesIO() as dst: |
nothing calls this directly
no test coverage detected