Updated the code for unix

This commit is contained in:
Maximilien Rigaut 2022-01-26 21:05:47 +01:00
parent 149be8781c
commit 89d585f0c2
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import bootstraparse.modules.pathresolver as pathr
import os
import re
pathlike_regexp = r'^[A-z]\:\\.+[/\\]src[/\\]bootstraparse[/\\]?$'
pathlike_regexp = r'^([A-z]\:\\|/).+[/\\]src[/\\]bootstraparse[/\\]?$'
test_path = '/a/b/c/test'
test_path_win = test_path.replace('/', '\\')
@ -10,7 +10,7 @@ test_path_win = test_path.replace('/', '\\')
def test_pathresolver():
path = pathr.pathresolver(test_path)
assert path() == os.path.normpath(test_path)
assert path() == test_path_win
assert path().replace('/', '\\') == test_path_win
assert path().replace('\\', '/') == test_path