test(#91): assert sidecar paths via as_posix() for the Windows CI runner
CI / Lint (ruff) (pull_request) Successful in 9s
CI / Tests (py3.12 / windows-latest) (pull_request) Successful in 22s
CI / Tests (py3.10 / ubuntu-latest) (pull_request) Successful in 13s
CI / Tests (py3.12 / ubuntu-latest) (pull_request) Successful in 15s
CI / Tests (py3.13 / ubuntu-latest) (pull_request) Successful in 13s
CI / Catalog signature (pull_request) Successful in 8s
CI / Lint (ruff) (pull_request) Successful in 9s
CI / Tests (py3.12 / windows-latest) (pull_request) Successful in 22s
CI / Tests (py3.10 / ubuntu-latest) (pull_request) Successful in 13s
CI / Tests (py3.12 / ubuntu-latest) (pull_request) Successful in 15s
CI / Tests (py3.13 / ubuntu-latest) (pull_request) Successful in 13s
CI / Catalog signature (pull_request) Successful in 8s
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8c51c25211
commit
2e5d0351b4
+9
-6
@@ -3305,20 +3305,23 @@ _HOME = "/Users/tester"
|
|||||||
|
|
||||||
|
|
||||||
def test_sidecar_path_verified_per_platform():
|
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"]
|
spec = c.SERVER_SPECS["ssh-mcp"]
|
||||||
mac = c.sidecar_path(spec, platform="darwin", environ={}, home=_HOME)
|
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.
|
# Windows resolves under %APPDATA%, not ~/.config.
|
||||||
win = c.sidecar_path(
|
win = c.sidecar_path(
|
||||||
spec, platform="win32", environ={"APPDATA": "C:/Users/t/AppData/Roaming"}, home=_HOME
|
spec, platform="win32", environ={"APPDATA": "C:/Users/t/AppData/Roaming"}, home=_HOME
|
||||||
)
|
)
|
||||||
assert "ssh-mcp/config.toml" in str(win)
|
assert "ssh-mcp/config.toml" in win.as_posix()
|
||||||
assert "AppData/Roaming" in str(win)
|
assert "AppData/Roaming" in win.as_posix()
|
||||||
# POSIX honours XDG_CONFIG_HOME, else ~/.config.
|
# POSIX honours XDG_CONFIG_HOME, else ~/.config.
|
||||||
xdg = c.sidecar_path(spec, platform="linux", environ={"XDG_CONFIG_HOME": "/cfg"}, home=_HOME)
|
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)
|
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():
|
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():
|
def test_sidecar_wrong_path_flag_on_macos():
|
||||||
# A TOML written at the README's ~/.config path is never read 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)
|
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(
|
st = c.sidecar_status(
|
||||||
_SSH, platform="darwin", environ={}, home=_HOME, exists=lambda p: p == doc
|
_SSH, platform="darwin", environ={}, home=_HOME, exists=lambda p: p == doc
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user