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

Method test_init_with_x_mode

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

Source from the content-addressed store, hash-verified

603 self.assertEqual(f.mode, "wb")
604
605 def test_init_with_x_mode(self):
606 self.addCleanup(unlink, TESTFN)
607 for mode in ("x", "xb"):
608 unlink(TESTFN)
609 with LZMAFile(TESTFN, mode) as f:
610 self.assertIsInstance(f, LZMAFile)
611 self.assertEqual(f.mode, 'wb')
612 with self.assertRaises(FileExistsError):
613 LZMAFile(TESTFN, mode)
614
615 def test_init_bad_mode(self):
616 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