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

Method test_realpath_resolve_first

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

Source from the content-addressed store, hash-verified

780 @skip_if_ABSTFN_contains_backslash
781 @_parameterize({}, {'strict': True}, {'strict': ALLOW_MISSING})
782 def test_realpath_resolve_first(self, kwargs):
783 # Bug #1213894: The first component of the path, if not absolute,
784 # must be resolved too.
785
786 try:
787 os.mkdir(ABSTFN)
788 os.mkdir(ABSTFN + "/k")
789 os.symlink(ABSTFN, ABSTFN + "link")
790 with os_helper.change_cwd(dirname(ABSTFN)):
791 base = basename(ABSTFN)
792 self.assertEqual(realpath(base + "link", **kwargs), ABSTFN)
793 self.assertEqual(realpath(base + "link/k", **kwargs), ABSTFN + "/k")
794 finally:
795 os_helper.unlink(ABSTFN + "link")
796 os_helper.rmdir(ABSTFN + "/k")
797 os_helper.rmdir(ABSTFN)
798
799 @os_helper.skip_unless_symlink
800 @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