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

Method test_realpath_deep_recursion

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

Source from the content-addressed store, hash-verified

729 @skip_if_ABSTFN_contains_backslash
730 @_parameterize({}, {'strict': True}, {'strict': ALL_BUT_LAST}, {'strict': ALLOW_MISSING})
731 def test_realpath_deep_recursion(self, kwargs):
732 depth = 10
733 try:
734 os.mkdir(ABSTFN)
735 for i in range(depth):
736 os.symlink('/'.join(['%d' % i] * 10), ABSTFN + '/%d' % (i + 1))
737 os.symlink('.', ABSTFN + '/0')
738 self.assertEqual(realpath(ABSTFN + '/%d' % depth, **kwargs), ABSTFN)
739
740 # Test using relative path as well.
741 with os_helper.change_cwd(ABSTFN):
742 self.assertEqual(realpath('%d' % depth), ABSTFN)
743 finally:
744 for i in range(depth + 1):
745 os_helper.unlink(ABSTFN + '/%d' % i)
746 os_helper.rmdir(ABSTFN)
747
748 @os_helper.skip_unless_symlink
749 @skip_if_ABSTFN_contains_backslash

Callers

nothing calls this directly

Calls 6

realpathFunction · 0.90
rmdirMethod · 0.80
mkdirMethod · 0.45
joinMethod · 0.45
assertEqualMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected