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

Method test_realpath_resolve_first

Lib/test/test_posixpath.py:801–816  ·  view source on GitHub ↗
(self, kwargs)

Source from the content-addressed store, hash-verified

799 @skip_if_ABSTFN_contains_backslash
800 @_parameterize({}, {'strict': True}, {'strict': ALL_BUT_LAST}, {'strict': ALLOW_MISSING})
801 def test_realpath_resolve_first(self, kwargs):
802 # Bug #1213894: The first component of the path, if not absolute,
803 # must be resolved too.
804
805 try:
806 os.mkdir(ABSTFN)
807 os.mkdir(ABSTFN + "/k")
808 os.symlink(ABSTFN, ABSTFN + "link")
809 with os_helper.change_cwd(dirname(ABSTFN)):
810 base = basename(ABSTFN)
811 self.assertEqual(realpath(base + "link", **kwargs), ABSTFN)
812 self.assertEqual(realpath(base + "link/k", **kwargs), ABSTFN + "/k")
813 finally:
814 os_helper.unlink(ABSTFN + "link")
815 os_helper.rmdir(ABSTFN + "/k")
816 os_helper.rmdir(ABSTFN)
817
818 @os_helper.skip_unless_symlink
819 @skip_if_ABSTFN_contains_backslash

Callers

nothing calls this directly

Calls 7

dirnameFunction · 0.90
basenameFunction · 0.90
realpathFunction · 0.90
rmdirMethod · 0.80
mkdirMethod · 0.45
assertEqualMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected