Lines Matching refs:path
266 # Special case for the empty path.
293 # The repr() is in the form ClassName("forward-slashes path").
392 # When the path is absolute, the anchor is a separate part.
1252 # Joining with a different drive => the first path is ignored, even
1253 # if the second path is relative.
1260 # Joining with the same drive => the first path is appended to if
1261 # the second path is relative.
1275 # Joining with a different drive => the first path is ignored, even
1276 # if the second path is relative.
1282 # Joining with the same drive => the first path is appended to if
1283 # the second path is relative.
1315 # of a path component.
1318 # Only the last path component matters.
1352 # Make sure any symbolic links in the base test path are resolved.
1353 BASE = os.path.realpath(TESTFN)
1354 join = lambda *x: os.path.join(BASE, *x)
1355 rel_join = lambda *x: os.path.join(TESTFN, *x)
1431 self.dirlink(os.path.join('..', 'dirB'), join('dirA', 'linkC'))
1433 self.dirlink(os.path.join('..', 'dirB'), join('dirB', 'linkD'))
1446 self.assertTrue(os.path.samefile(str(path_a), str(path_b)),
1456 self.assertEqual(os.path.normcase(path_a), os.path.normcase(path_b))
1478 self.assertEqual(str(P('a').absolute()), os.path.join(BASE, 'a'))
1479 self.assertEqual(str(P('a', 'b', 'c').absolute()), os.path.join(BASE, 'a', 'b', 'c'))
1482 self.assertEqual(str(P('linkB', 'fileB').absolute()), os.path.join(BASE, 'linkB', 'fileB'))
1483 self.assertEqual(str(P('brokenLink').absolute()), os.path.join(BASE, 'brokenLink'))
1484 self.assertEqual(str(P('brokenLinkLoop').absolute()), os.path.join(BASE, 'brokenLinkLoop'))
1487 self.assertEqual(str(P('..').absolute()), os.path.join(BASE, '..'))
1488 self.assertEqual(str(P('a', '..').absolute()), os.path.join(BASE, 'a', '..'))
1489 self.assertEqual(str(P('..', 'b').absolute()), os.path.join(BASE, '..', 'b'))
1492 q = self.cls(os.path.expanduser('~'))
1506 env['USERPROFILE'] = os.path.join(BASE, 'userprofile')
1510 env['HOME'] = os.path.join(BASE, 'home')
1514 fileA_path = os.path.join(BASE, 'fileA')
1515 fileB_path = os.path.join(BASE, 'dirB', 'fileB')
1524 non_existent = os.path.join(BASE, 'foo')
1534 # The empty path points to '.'
1542 self.assertEqual(p.expanduser(), P(os.path.expanduser('~')))
1780 def my_scandir(path):
1781 with real_scandir(path) as scandir_it:
1818 os.path.join(BASE, 'foo'))
1821 os.path.join(BASE, 'foo', 'in', 'spam'))
1824 os.path.abspath(os.path.join('foo', 'in', 'spam')))
1852 os.symlink(os.path.join(d), join('dirA', 'linkX'))
1853 os.symlink(join('dirB'), os.path.join(d, 'linkY'))
1875 self.dirlink(os.path.join('0', '0'), join('1'))
1876 self.dirlink(os.path.join('1', '1'), join('2'))
1899 # bpo-46556: path context managers are deprecated in Python 3.11.
1903 # Using a path as a context manager is a no-op, thus the following
2023 # linking to another path.
2031 self.assertEqual(os.path.samefile(p, q), True)
2033 # Linking to a str of a relative path.
2045 # linking to another path.
2049 self.assertTrue(os.path.samefile(target, link))
2051 # Linking to a str of a relative path.
2062 # linking to another path.
2071 # Renaming to another path.
2077 # Renaming to a str of a relative path.
2088 # Replacing a non-existing path.
2094 # Replacing another (existing) path.
2222 (p / 'child' / 'path').mkdir(parents=True)
2227 # An exception is raised when the last path component is an existing
2239 # An exception is raised when the last path component is an existing
2254 def my_mkdir(path, mode=0o777):
2255 path = str(path)
2262 real_mkdir(path, mode) # From another process.
2263 concurrently_created.add(path)
2264 real_mkdir(path, mode) # Our real call.
2282 # Symlinking a path target.
2369 "fifo requires special path on VxWorks")
2406 "AF_UNIX path too long" in str(e)):
2462 self.dirlink(os.path.join('link0', 'link0'), join('link1'))
2463 self.dirlink(os.path.join('link1', 'link1'), join('link2'))
2464 self.dirlink(os.path.join('link2', 'link2'), join('link3'))
2510 self._check_complex_symlinks(os.path.join('dirA', '..'))
2543 # '//'-prefixed absolute path (supported by POSIX).
2549 path = self.cls(*args)
2551 print(path.resolve(strict))
2741 self.assertEqual(str(P('a').absolute()), os.path.join(share, 'a'))
2743 os.path.join(share, 'a', 'b', 'c'))
2771 # test that the path returns unchanged