(self)
| 638 | |
| 639 | @unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: Invalid check value |
| 640 | def test_init_bad_check(self): |
| 641 | with self.assertRaises(TypeError): |
| 642 | LZMAFile(BytesIO(), "w", check=b"asd") |
| 643 | # CHECK_UNKNOWN and anything above CHECK_ID_MAX should be invalid. |
| 644 | with self.assertRaises(LZMAError): |
| 645 | LZMAFile(BytesIO(), "w", check=lzma.CHECK_UNKNOWN) |
| 646 | with self.assertRaises(LZMAError): |
| 647 | LZMAFile(BytesIO(), "w", check=lzma.CHECK_ID_MAX + 3) |
| 648 | # Cannot specify a check with mode="r". |
| 649 | with self.assertRaises(ValueError): |
| 650 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_NONE) |
| 651 | with self.assertRaises(ValueError): |
| 652 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_CRC32) |
| 653 | with self.assertRaises(ValueError): |
| 654 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_CRC64) |
| 655 | with self.assertRaises(ValueError): |
| 656 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_SHA256) |
| 657 | with self.assertRaises(ValueError): |
| 658 | LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_UNKNOWN) |
| 659 | |
| 660 | @unittest.expectedFailure # TODO: RUSTPYTHON; OverflowError: Python int too large to convert to Rust u32 |
| 661 | def test_init_bad_preset(self): |
nothing calls this directly
no test coverage detected