Home | History | Annotate | Download | only in unittest2

Lines Matching full:path

15 def _relpath_nt(path, start=os.path.curdir):
16 """Return a relative version of a path"""
18 if not path:
19 raise ValueError("no path specified")
20 start_list = os.path.abspath(start).split(os.path.sep)
21 path_list = os.path.abspath(path).split(os.path.sep)
23 unc_path, rest = os.path.splitunc(path)
24 unc_start, rest = os.path.splitunc(start)
27 % (path, start))
29 raise ValueError("path is on drive %s, start on drive %s"
31 # Work out how much of the filepath is shared by start and path.
38 rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
40 return os.path.curdir
41 return os.path.join(*rel_list)
44 def _relpath_posix(path, start=os.path.curdir):
45 """Return a relative version of a path"""
47 if not path:
48 raise ValueError("no path specified")
50 start_list = os.path.abspath(start).split(os.path.sep)
51 path_list = os.path.abspath(path).split(os.path.sep)
53 # Work out how much of the filepath is shared by start and path.
54 i = len(os.path.commonprefix([start_list, path_list]))
56 rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
58 return os.path.curdir
59 return os.path.join(*rel_list)
61 if os.path is sys.modules.get('ntpath'):