Skip to content

Commit 5f6adda

Browse files
committed
Fix full-root path expectations
1 parent 5eea338 commit 5f6adda

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/scancode/test_cli.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ def test_scan_info_returns_full_root():
167167
result_data = json.loads(open(result_file).read())
168168
file_paths = [f['path'] for f in result_data['files']]
169169
assert len(file_paths) == 12
170-
# note that we strip paths from leading and trailing slashes
171-
root = fileutils.as_posixpath(test_dir).strip('/')
170+
root = fileutils.as_posixpath(test_dir)
172171
assert all(p.startswith(root) for p in file_paths)
173172

174173

@@ -182,9 +181,8 @@ def test_scan_info_returns_correct_full_root_with_single_file():
182181
# we have a single file
183182
assert len(files) == 1
184183
scanned_file = files[0]
185-
# and we check that the path is the full path without repeating the file name
186-
# note that the path never contain leading and trailing slashes
187-
assert scanned_file['path'] == fileutils.as_posixpath(test_file).strip('/')
184+
# and we check that the path is the full absolute path without repeating the file name
185+
assert scanned_file['path'] == fileutils.as_posixpath(test_file)
188186

189187

190188
def test_scan_info_returns_does_not_strip_root_with_single_file():

0 commit comments

Comments
 (0)