Skip to content

Commit 65b0ea1

Browse files
Run the POSIX colon-name test with an explicit flavor
On Windows, normalize_file_path uses the Windows flavor, where 'x:y/creds.txt' is a drive-relative path and the drive is correctly stripped. Pass the Linux flavor explicitly so the case asserts the same thing on every CI runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c65958f commit 65b0ea1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎tests/cli/utils/test_path_utils.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ def test_concat_unique_id_keeps_server_and_share_for_unc_path() -> None:
3838
('./repo/creds.txt', 'repo/creds.txt'),
3939
('repo/creds.txt', 'repo/creds.txt'),
4040
('', ''),
41-
# a colon is a legal character in a posix file name and must not be read as a drive
42-
('x:y/creds.txt', 'x:y/creds.txt'),
4341
],
4442
)
45-
def test_normalize_file_path_on_posix(path: str, expected: str) -> None:
43+
def test_normalize_file_path(path: str, expected: str) -> None:
4644
assert normalize_file_path(path) == expected
4745

4846

47+
def test_normalize_file_path_keeps_colon_in_posix_name() -> None:
48+
# a colon is a legal character in a posix file name and must not be read as a drive
49+
assert str(PurePosixPath(*_to_relative_posix_parts('x:y/creds.txt', OperatingSystem.LINUX))) == 'x:y/creds.txt'
50+
51+
4952
@pytest.mark.parametrize(
5053
('path', 'expected'),
5154
[

0 commit comments

Comments
 (0)