Lines Matching defs:path
34 def _getshortpathname(path):
38 result_len = GSPN(path, None, 0)
40 raise OSError("failed to get short path name 0x{:08X}"
43 result_len = GSPN(path, result, result_len)
46 def _norm(path):
47 if isinstance(path, (bytes, str, os.PathLike)):
48 return ntpath.normcase(os.fsdecode(path))
49 elif hasattr(path, "__iter__"):
50 return tuple(ntpath.normcase(os.fsdecode(p)) for p in path)
51 return path
84 def assertPathIn(self, path, pathset):
85 self.assertIn(_norm(path), _norm(pathset))
343 # a path that does not exist.
424 # path is returned, but it will always be the fully resolved path of
464 # Test using relative path as well.
507 # Test using relative path as well.
849 drive, path = ntpath.splitdrive(test_cwd)
871 for path in executable, os.fsencode(executable):
872 volume_path = nt._getvolumepathname(path)
873 path_drive = ntpath.splitdrive(path)[0]
885 for path in [sys.prefix, sys.executable]:
886 final_path = nt._getfinalpathname(path)
890 b_final_path = nt._getfinalpathname(path.encode())
901 path = ntpath
914 self._check_function(self.path.normcase)
919 self._check_function(self.path.isabs)
922 self.assertEqual(self.path.join('a', FakePath('b'), 'c'),
923 self.path.join('a', 'b', 'c'))
926 self._check_function(self.path.split)
929 self._check_function(self.path.splitext)
932 self._check_function(self.path.splitdrive)
935 self._check_function(self.path.basename)
938 self._check_function(self.path.dirname)
941 self._check_function(self.path.islink)
944 self._check_function(self.path.lexists)
947 self._check_function(self.path.ismount)
950 self._check_function(self.path.expanduser)
953 self._check_function(self.path.expandvars)
956 self._check_function(self.path.normpath)
959 self._check_function(self.path.abspath)
962 self._check_function(self.path.realpath)
965 self._check_function(self.path.relpath)
968 common_path = self.path.commonpath([self.file_path, self.file_name])
972 self._check_function(self.path.isdir)