(self)
| 1345 | self.assertRaises(ValueError, f.tell) |
| 1346 | |
| 1347 | def test_issue21872(self): |
| 1348 | # sometimes decompress data incompletely |
| 1349 | |
| 1350 | # --------------------- |
| 1351 | # when max_length == -1 |
| 1352 | # --------------------- |
| 1353 | d1 = LZMADecompressor() |
| 1354 | entire = d1.decompress(ISSUE_21872_DAT, max_length=-1) |
| 1355 | self.assertEqual(len(entire), 13160) |
| 1356 | self.assertTrue(d1.eof) |
| 1357 | |
| 1358 | # --------------------- |
| 1359 | # when max_length > 0 |
| 1360 | # --------------------- |
| 1361 | d2 = LZMADecompressor() |
| 1362 | |
| 1363 | # When this value of max_length is used, the input and output |
| 1364 | # buffers are exhausted at the same time, and lzs's internal |
| 1365 | # state still have 11 bytes can be output. |
| 1366 | out1 = d2.decompress(ISSUE_21872_DAT, max_length=13149) |
| 1367 | self.assertFalse(d2.needs_input) # ensure needs_input mechanism works |
| 1368 | self.assertFalse(d2.eof) |
| 1369 | |
| 1370 | # simulate needs_input mechanism |
| 1371 | # output internal state's 11 bytes |
| 1372 | out2 = d2.decompress(b'') |
| 1373 | self.assertEqual(len(out2), 11) |
| 1374 | self.assertTrue(d2.eof) |
| 1375 | self.assertEqual(out1 + out2, entire) |
| 1376 | |
| 1377 | def test_issue44439(self): |
| 1378 | q = array.array('Q', [1, 2, 3, 4, 5]) |
nothing calls this directly
no test coverage detected