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

Method test_path_error2

Lib/test/test_os/test_posix.py:1540–1556  ·  view source on GitHub ↗

Test functions that call path_error2(), providing two filenames in their exceptions.

(self)

Source from the content-addressed store, hash-verified

1538 raise unittest.SkipTest("OSError raised!")
1539
1540 def test_path_error2(self):
1541 """
1542 Test functions that call path_error2(), providing two filenames in their exceptions.
1543 """
1544 for name in ("rename", "replace", "link"):
1545 function = getattr(os, name, None)
1546 if function is None:
1547 continue
1548
1549 for dst in ("noodly2", os_helper.TESTFN):
1550 try:
1551 function('doesnotexistfilename', dst)
1552 except OSError as e:
1553 self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e))
1554 break
1555 else:
1556 self.fail("No valid path_error2() test for os." + name)
1557
1558 def test_path_with_null_character(self):
1559 fn = os_helper.TESTFN

Callers

nothing calls this directly

Calls 5

strFunction · 0.85
assertInMethod · 0.80
functionFunction · 0.50
formatMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected