Skip to content

Commit 0a4adbe

Browse files
committed
CM-59977 fixed restore test to use OS-agnostic paths
1 parent 15bd641 commit 0a4adbe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/cli/files_collector/sca/npm/test_restore_npm_dependencies.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ def test_get_lock_file_names_contains_only_npm_lock(self, restore_npm: RestoreNp
101101

102102
class TestPrepareManifestFilePath:
103103
def test_strips_package_json_filename(self, restore_npm: RestoreNpmDependencies) -> None:
104-
assert restore_npm.prepare_manifest_file_path_for_command('/path/to/package.json') == '/path/to'
104+
path = str(Path('/path/to/package.json'))
105+
expected = str(Path('/path/to'))
106+
assert restore_npm.prepare_manifest_file_path_for_command(path) == expected
105107

106108
def test_package_json_in_cwd_returns_empty_string(self, restore_npm: RestoreNpmDependencies) -> None:
107109
assert restore_npm.prepare_manifest_file_path_for_command('package.json') == ''
108110

109111
def test_non_package_json_path_returned_unchanged(self, restore_npm: RestoreNpmDependencies) -> None:
110-
assert restore_npm.prepare_manifest_file_path_for_command('/path/to/') == '/path/to/'
112+
path = str(Path('/path/to/'))
113+
assert restore_npm.prepare_manifest_file_path_for_command(path) == path

0 commit comments

Comments
 (0)