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

Method test_resolve_dot

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

Source from the content-addressed store, hash-verified

1906
1907 @needs_symlinks
1908 def test_resolve_dot(self):
1909 # See http://web.archive.org/web/20200623062557/https://bitbucket.org/pitrou/pathlib/issues/9/
1910 parser = self.parser
1911 p = self.cls(self.base)
1912 p.joinpath('0').symlink_to('.', target_is_directory=True)
1913 p.joinpath('1').symlink_to(parser.join('0', '0'), target_is_directory=True)
1914 p.joinpath('2').symlink_to(parser.join('1', '1'), target_is_directory=True)
1915 q = p / '2'
1916 self.assertEqual(q.resolve(strict=True), p)
1917 r = q / '3' / '4'
1918 self.assertRaises(FileNotFoundError, r.resolve, strict=True)
1919 # Non-strict
1920 self.assertEqual(r.resolve(strict=False), p / '3' / '4')
1921
1922 def _check_symlink_loop(self, *args):
1923 path = self.cls(*args)

Callers

nothing calls this directly

Calls 7

clsMethod · 0.45
symlink_toMethod · 0.45
joinpathMethod · 0.45
joinMethod · 0.45
assertEqualMethod · 0.45
resolveMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected