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

Method test_init_with_x_mode

Lib/test/test_zstd.py:1626–1636  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1624 pass
1625
1626 def test_init_with_x_mode(self):
1627 with tempfile.NamedTemporaryFile() as tmp_f:
1628 filename = pathlib.Path(tmp_f.name)
1629
1630 for mode in ("x", "xb"):
1631 with ZstdFile(filename, mode):
1632 pass
1633 with self.assertRaises(FileExistsError):
1634 with ZstdFile(filename, mode):
1635 pass
1636 os.remove(filename)
1637
1638 def test_init_bad_mode(self):
1639 with self.assertRaises(ValueError):

Callers

nothing calls this directly

Calls 3

ZstdFileClass · 0.90
assertRaisesMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected