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

Method test_init_bad_preset

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

Source from the content-addressed store, hash-verified

659
660 @unittest.expectedFailure # TODO: RUSTPYTHON; OverflowError: Python int too large to convert to Rust u32
661 def test_init_bad_preset(self):
662 with self.assertRaises(TypeError):
663 LZMAFile(BytesIO(), "w", preset=4.39)
664 with self.assertRaises(LZMAError):
665 LZMAFile(BytesIO(), "w", preset=10)
666 with self.assertRaises(LZMAError):
667 LZMAFile(BytesIO(), "w", preset=23)
668 with self.assertRaises(ValueError):
669 LZMAFile(BytesIO(), "w", preset=-1)
670 with self.assertRaises(ValueError):
671 LZMAFile(BytesIO(), "w", preset=-7)
672 with self.assertRaises(OverflowError):
673 LZMAFile(BytesIO(), "w", preset=2**1000)
674 with self.assertRaises(TypeError):
675 LZMAFile(BytesIO(), "w", preset="foo")
676 # Cannot specify a preset with mode="r".
677 with self.assertRaises(ValueError):
678 LZMAFile(BytesIO(COMPRESSED_XZ), preset=3)
679
680 @unittest.expectedFailure # TODO: RUSTPYTHON; lzma.LZMAError: Failed to initialize encoder
681 def test_init_bad_filter_spec(self):

Callers

nothing calls this directly

Calls 3

LZMAFileClass · 0.90
BytesIOClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected