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

Method test_realpath_missing_pardir

Lib/test/test_posixpath.py:619–628  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

617 @os_helper.skip_unless_symlink
618 @skip_if_ABSTFN_contains_backslash
619 def test_realpath_missing_pardir(self):
620 try:
621 os.symlink(TESTFN + "1", TESTFN)
622 path = "nonexistent/../" + TESTFN
623 self.assertEqual(realpath(path), ABSTFN + "1")
624 self.assertEqual(realpath(path, strict=ALLOW_MISSING), ABSTFN + "1")
625 self.assertRaises(FileNotFoundError, realpath, path, strict=ALL_BUT_LAST)
626 self.assertRaises(FileNotFoundError, realpath, path, strict=True)
627 finally:
628 os_helper.unlink(TESTFN)
629
630 @os_helper.skip_unless_symlink
631 @skip_if_ABSTFN_contains_backslash

Callers

nothing calls this directly

Calls 4

realpathFunction · 0.90
assertEqualMethod · 0.45
assertRaisesMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected