Skip to content

Commit

Permalink
Fix unit tests for strippath to also use absolute instead of relative…
Browse files Browse the repository at this point in the history
… paths on Windows
  • Loading branch information
lxp committed Jul 31, 2021
1 parent 60879f0 commit fdec15f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/cfv/osutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ def path_split(filename):
def strippath(filename, num='a', _splitdrivere=re.compile(r'[a-z]:[/\\]', re.I)):
"""Strip off path components from the left side of the filename.
>>> strippath(os.path.join('c:','foo','bar','baz'))
>>> strippath(os.path.join('c:' + os.sep,'foo','bar','baz'))
'baz'
>>> path_split(strippath(os.path.join('c:','foo','bar','baz'), 'n'))
>>> path_split(strippath(os.path.join('c:' + os.sep,'foo','bar','baz'), 'n'))
['c:', 'foo', 'bar', 'baz']
>>> path_split(strippath(os.path.join('c:','foo','bar','baz'), 0))
>>> path_split(strippath(os.path.join('c:' + os.sep,'foo','bar','baz'), 0))
['foo', 'bar', 'baz']
>>> path_split(strippath(os.path.join(os.sep,'foo','bar','baz'), 0))
['foo', 'bar', 'baz']
>>> path_split(strippath(os.path.join('c:','foo','bar','baz'), 1))
>>> path_split(strippath(os.path.join('c:' + os.sep,'foo','bar','baz'), 1))
['bar', 'baz']
>>> strippath(os.path.join('c:','foo','bar','baz'), 2)
>>> strippath(os.path.join('c:' + os.sep,'foo','bar','baz'), 2)
'baz'
>>> strippath(os.path.join('c:','foo','bar','baz'), 3)
>>> strippath(os.path.join('c:' + os.sep,'foo','bar','baz'), 3)
'baz'
"""
if num == 'a': # split all the path off
Expand Down

0 comments on commit fdec15f

Please sign in to comment.