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

Method test_init_with_x_mode

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

Source from the content-addressed store, hash-verified

597 self.assertEqual(f.mode, "wb")
598
599 def test_init_with_x_mode(self):
600 self.addCleanup(unlink, TESTFN)
601 for mode in ("x", "xb"):
602 unlink(TESTFN)
603 with LZMAFile(TESTFN, mode) as f:
604 self.assertIsInstance(f, LZMAFile)
605 self.assertEqual(f.mode, 'wb')
606 with self.assertRaises(FileExistsError):
607 LZMAFile(TESTFN, mode)
608
609 def test_init_bad_mode(self):
610 with self.assertRaises(ValueError):

Callers

nothing calls this directly

Calls 6

unlinkFunction · 0.90
LZMAFileClass · 0.90
addCleanupMethod · 0.80
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected