Skip to content

Commit 2c0949e

Browse files
committed
Fix CI tests on Windows
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 19cebae commit 2c0949e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

tests/test_command.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,21 @@ def test_searchable_paths(self):
119119

120120
env_vars = 'FOO_SCANCODE_TEST1', 'FOO_SCANCODE_TEST2'
121121
expected = d1, d2, d2, d1
122-
if on_mac:
122+
123+
results = command.searchable_paths(env_vars=env_vars)
124+
if on_windows:
125+
for res, exp in zip(results, expected):
126+
_, _, r = res.rpartition('\\')
127+
_, _, e = exp.rpartition('\\')
128+
assert r == e
129+
130+
elif on_mac:
123131
# macOS somehow adds a /private to the paths in the CI as a side-
124132
# effect of calling "realpath" and likely resolving links
125133
expected = f'/private{d1}', f'/private{d2}', f'/private{d2}', f'/private{d1}'
126-
assert expected == command.searchable_paths(env_vars=env_vars)
134+
assert expected == results
135+
else:
136+
assert expected == results
127137

128138
def test_find_in_path(self):
129139
d1 = self.get_temp_dir('foo')

0 commit comments

Comments
 (0)