MCPcopy Index your code
hub / github.com/python/cpython / test_init_bad_mode

Method test_init_bad_mode

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

Source from the content-addressed store, hash-verified

607 LZMAFile(TESTFN, mode)
608
609 def test_init_bad_mode(self):
610 with self.assertRaises(ValueError):
611 LZMAFile(BytesIO(COMPRESSED_XZ), (3, "x"))
612 with self.assertRaises(ValueError):
613 LZMAFile(BytesIO(COMPRESSED_XZ), "")
614 with self.assertRaises(ValueError):
615 LZMAFile(BytesIO(COMPRESSED_XZ), "xt")
616 with self.assertRaises(ValueError):
617 LZMAFile(BytesIO(COMPRESSED_XZ), "x+")
618 with self.assertRaises(ValueError):
619 LZMAFile(BytesIO(COMPRESSED_XZ), "rx")
620 with self.assertRaises(ValueError):
621 LZMAFile(BytesIO(COMPRESSED_XZ), "wx")
622 with self.assertRaises(ValueError):
623 LZMAFile(BytesIO(COMPRESSED_XZ), "rt")
624 with self.assertRaises(ValueError):
625 LZMAFile(BytesIO(COMPRESSED_XZ), "r+")
626 with self.assertRaises(ValueError):
627 LZMAFile(BytesIO(COMPRESSED_XZ), "wt")
628 with self.assertRaises(ValueError):
629 LZMAFile(BytesIO(COMPRESSED_XZ), "w+")
630 with self.assertRaises(ValueError):
631 LZMAFile(BytesIO(COMPRESSED_XZ), "rw")
632
633 def test_init_bad_check(self):
634 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 3

LZMAFileClass · 0.90
BytesIOClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected