Lines Matching refs:path
18 # An absolute path to a temporary filename for testing. We can't rely on TESTFN
19 # being an absolute path, so we need this.
30 msg = "ABSTFN is not a posix path - tests fail"
76 def splitextTest(self, path, filename, ext):
77 self.assertEqual(posixpath.splitext(path), (filename, ext))
78 self.assertEqual(posixpath.splitext("/" + path), ("/" + filename, ext))
79 self.assertEqual(posixpath.splitext("abc/" + path),
81 self.assertEqual(posixpath.splitext("abc.def/" + path),
83 self.assertEqual(posixpath.splitext("/abc.def/" + path),
85 self.assertEqual(posixpath.splitext(path + "/"),
88 path = bytes(path, "ASCII")
92 self.assertEqual(posixpath.splitext(path), (filename, ext))
93 self.assertEqual(posixpath.splitext(b"/" + path),
95 self.assertEqual(posixpath.splitext(b"abc/" + path),
97 self.assertEqual(posixpath.splitext(b"abc.def/" + path),
99 self.assertEqual(posixpath.splitext(b"/abc.def/" + path),
101 self.assertEqual(posixpath.splitext(path + b"/"),
209 # Simulate the path being on a different device from its parent by
212 def fake_lstat(path):
215 if path == ABSTFN:
230 def fake_lstat(path):
233 if path.startswith(ABSTFN) and path != ABSTFN:
237 if path == ABSTFN:
300 # user (current identifier or name in the path) doesn't exist in
302 # expanduser() must return the path unchanged.
305 for path in ('~', '~/.local', '~vstinner/'):
306 self.assertEqual(posixpath.expanduser(path), path)
360 for path, expected in self.NORMPATH_CASES:
361 with self.subTest(path):
362 result = posixpath.normpath(path)
365 path = path.encode('utf-8')
367 with self.subTest(path, type=bytes):
368 result = posixpath.normpath(path)
405 # a path that does not exist.
425 # Bug #930024, return the path unchanged if we get into an infinite
452 # Test using relative path as well.
493 # Test using relative path as well.
529 # Test using relative path as well.
541 # path passed to realpath. E.g.: current working directory is
560 # normalize the path. E.g.: if we have directories 'a', 'k' and 'y'
572 # Absolute path.
574 # Relative path.
587 # Bug #1213894: The first component of the path, if not absolute,
606 curdir = os.path.split(os.getcwd())[-1]
632 curdir = os.path.split(os.getcwdb())[-1]
721 path = posixpath
734 self.assertPathEqual(self.path.normcase)
737 self.assertPathEqual(self.path.isabs)
740 self.assertEqual(self.path.join('a', FakePath('b'), 'c'),
741 self.path.join('a', 'b', 'c'))
744 self.assertPathEqual(self.path.split)
747 self.assertPathEqual(self.path.splitext)
750 self.assertPathEqual(self.path.splitdrive)
753 self.assertPathEqual(self.path.basename)
756 self.assertPathEqual(self.path.dirname)
759 self.assertPathEqual(self.path.islink)
762 self.assertPathEqual(self.path.lexists)
765 self.assertPathEqual(self.path.ismount)
768 self.assertPathEqual(self.path.expanduser)
771 self.assertPathEqual(self.path.expandvars)
774 self.assertPathEqual(self.path.normpath)
777 self.assertPathEqual(self.path.abspath)
780 self.assertPathEqual(self.path.realpath)
783 self.assertPathEqual(self.path.relpath)
786 common_path = self.path.commonpath([self.file_path, self.file_name])