MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_init_bad_check

Method test_init_bad_check

Lib/test/test_lzma.py:640–658  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 3

LZMAFileClass · 0.90
BytesIOClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected