(self)
| 631 | LZMAFile(BytesIO(COMPRESSED_XZ), "rw") |
| 632 | |
| 633 | def test_init_bad_check(self): |
| 634 | with self.assertRaises(TypeError): |
| 635 | LZMAFile(BytesIO(), "w", check=b"asd") |
| 636 | # CHECK_UNKNOWN and anything above CHECK_ID_MAX should be invalid. |
| 637 | with self.assertRaises(LZMAError): |
| 638 | LZMAFile(BytesIO(), "w", check=lzma.CHECK_UNKNOWN) |
| 639 | with self.assertRaises(LZMAError): |
| 640 | LZMAFile(BytesIO(), "w", check=lzma.CHECK_ID_MAX + 3) |
| 641 | # Cannot specify a check with mode="r". |
| 642 | with self.assertRaises(ValueError): |
| 643 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_NONE) |
| 644 | with self.assertRaises(ValueError): |
| 645 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_CRC32) |
| 646 | with self.assertRaises(ValueError): |
| 647 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_CRC64) |
| 648 | with self.assertRaises(ValueError): |
| 649 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_SHA256) |
| 650 | with self.assertRaises(ValueError): |
| 651 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_UNKNOWN) |
| 652 | |
| 653 | def test_init_bad_preset(self): |
| 654 | with self.assertRaises(TypeError): |
nothing calls this directly
no test coverage detected