From 2e5d0351b42f203905e18df60f67d4f519c73ebe Mon Sep 17 00:00:00 2001 From: Cowork Supervisor Date: Wed, 12 Aug 2026 03:07:47 -0400 Subject: [PATCH] test(#91): assert sidecar paths via as_posix() for the Windows CI runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CI matrix includes a windows-latest job where str(Path("/Users/…")) renders with backslashes, so the platform-parameterised sidecar-path assertions failed there (macOS/Linux passed). Compare .as_posix() instead — separator-normalised and portable — and note why. Pure test fix; no production-code change. Co-Authored-By: Claude Opus 4.8 --- tests/test_core.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 3e0a9a9..797b93e 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3305,20 +3305,23 @@ _HOME = "/Users/tester" def test_sidecar_path_verified_per_platform(): + # NOTE: assert on .as_posix() — the CI matrix includes a Windows runner where + # str(Path("/Users/…")) would render with backslashes. as_posix() normalises + # separators so these platform-parameterised checks are portable. spec = c.SERVER_SPECS["ssh-mcp"] mac = c.sidecar_path(spec, platform="darwin", environ={}, home=_HOME) - assert str(mac) == "/Users/tester/Library/Application Support/ssh-mcp/config.toml" + assert mac.as_posix() == "/Users/tester/Library/Application Support/ssh-mcp/config.toml" # Windows resolves under %APPDATA%, not ~/.config. win = c.sidecar_path( spec, platform="win32", environ={"APPDATA": "C:/Users/t/AppData/Roaming"}, home=_HOME ) - assert "ssh-mcp/config.toml" in str(win) - assert "AppData/Roaming" in str(win) + assert "ssh-mcp/config.toml" in win.as_posix() + assert "AppData/Roaming" in win.as_posix() # POSIX honours XDG_CONFIG_HOME, else ~/.config. xdg = c.sidecar_path(spec, platform="linux", environ={"XDG_CONFIG_HOME": "/cfg"}, home=_HOME) - assert str(xdg) == "/cfg/ssh-mcp/config.toml" + assert xdg.as_posix() == "/cfg/ssh-mcp/config.toml" default = c.sidecar_path(spec, platform="linux", environ={}, home=_HOME) - assert str(default) == "/Users/tester/.config/ssh-mcp/config.toml" + assert default.as_posix() == "/Users/tester/.config/ssh-mcp/config.toml" def test_sidecar_path_none_for_non_sidecar_package(): @@ -3355,7 +3358,7 @@ def test_sidecar_args_live_when_file_absent(): def test_sidecar_wrong_path_flag_on_macos(): # A TOML written at the README's ~/.config path is never read on macOS. doc = c.sidecar_doc_path(c.SERVER_SPECS["ssh-mcp"], home=_HOME) - assert str(doc) == "/Users/tester/.config/ssh-mcp/config.toml" + assert doc.as_posix() == "/Users/tester/.config/ssh-mcp/config.toml" st = c.sidecar_status( _SSH, platform="darwin", environ={}, home=_HOME, exists=lambda p: p == doc )