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

Method test_init_bad_mode

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

Source from the content-addressed store, hash-verified

613 LZMAFile(TESTFN, mode)
614
615 def test_init_bad_mode(self):
616 with self.assertRaises(ValueError):
617 LZMAFile(BytesIO(COMPRESSED_XZ), (3, "x"))
618 with self.assertRaises(ValueError):
619 LZMAFile(BytesIO(COMPRESSED_XZ), "")
620 with self.assertRaises(ValueError):
621 LZMAFile(BytesIO(COMPRESSED_XZ), "xt")
622 with self.assertRaises(ValueError):
623 LZMAFile(BytesIO(COMPRESSED_XZ), "x+")
624 with self.assertRaises(ValueError):
625 LZMAFile(BytesIO(COMPRESSED_XZ), "rx")
626 with self.assertRaises(ValueError):
627 LZMAFile(BytesIO(COMPRESSED_XZ), "wx")
628 with self.assertRaises(ValueError):
629 LZMAFile(BytesIO(COMPRESSED_XZ), "rt")
630 with self.assertRaises(ValueError):
631 LZMAFile(BytesIO(COMPRESSED_XZ), "r+")
632 with self.assertRaises(ValueError):
633 LZMAFile(BytesIO(COMPRESSED_XZ), "wt")
634 with self.assertRaises(ValueError):
635 LZMAFile(BytesIO(COMPRESSED_XZ), "w+")
636 with self.assertRaises(ValueError):
637 LZMAFile(BytesIO(COMPRESSED_XZ), "rw")
638
639 @unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: Invalid check value
640 def test_init_bad_check(self):

Callers

nothing calls this directly

Calls 3

LZMAFileClass · 0.90
BytesIOClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected