Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions py_src/jupyter_lsp/tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def test_normalize_posix_path_home_subdir(
assert normalized_uri(root_dir) == expected_root_uri


@pytest.mark.skipif(~WIN, reason="can't test Windows paths on POSIX")
@pytest.mark.skipif(not WIN, reason="can't test Windows paths on POSIX")
@pytest.mark.parametrize(
"root_dir, expected_root_uri",
[
["c:\\Users\\user1", "file:///c:/Users/user1"],
["C:\\Users\\user1", "file:///c:/Users/user1"],
["//VBOXSVR/shared-folder", "file://vboxsvr/shared-folder"],
["//VBOXSVR/shared-folder", "file://vboxsvr/shared-folder/"],
],
)
def test_normalize_windows_path_case(root_dir, expected_root_uri): # pragma: no cover
Expand All @@ -58,12 +58,13 @@ def test_file_uri_to_path_posix(file_uri, expected_posix_path): # pragma: no co
assert file_uri_to_path(file_uri) == expected_posix_path


@pytest.mark.skipif(~WIN, reason="can't test Windows paths on POSIX")
@pytest.mark.skipif(not WIN, reason="can't test Windows paths on POSIX")
@pytest.mark.parametrize(
"file_uri, expected_windows_path",
[
["file:///C:/Windows/System32/Drivers/etc", r"C:\Windows\System32\Drivers\etc"],
["file:///C:/some%20dir/some%20file.txt", r"C:\some dir\some file.txt"],
# https://github.com/krassowski/jupyterlab-lsp/pull/305#issuecomment-665996145
["file:///C:/Windows/System32/Drivers/etc", "C:/Windows/System32/Drivers/etc"],
["file:///C:/some%20dir/some%20file.txt", "C:/some dir/some file.txt"],
],
)
def test_file_uri_to_path_windows(file_uri, expected_windows_path): # pragma: no cover
Expand Down