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

Method test_rglob_symlink_loop

Lib/test/test_pathlib/test_pathlib.py:3105–3121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3103
3104 @needs_symlinks
3105 def test_rglob_symlink_loop(self):
3106 # Don't get fooled by symlink loops (Issue #26012).
3107 P = self.cls
3108 p = P(self.base)
3109 given = set(p.rglob('*', recurse_symlinks=False))
3110 expect = {'brokenLink',
3111 'dirA', 'dirA/linkC',
3112 'dirB', 'dirB/fileB', 'dirB/linkD',
3113 'dirC', 'dirC/dirD', 'dirC/dirD/fileD',
3114 'dirC/fileC', 'dirC/novel.txt',
3115 'dirE',
3116 'fileA',
3117 'linkA',
3118 'linkB',
3119 'brokenLinkLoop',
3120 }
3121 self.assertEqual(given, {p / x for x in expect})
3122
3123 @needs_symlinks
3124 def test_glob_permissions(self):

Callers

nothing calls this directly

Calls 4

setFunction · 0.85
PClass · 0.70
rglobMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected