Skip to content

Commit 28c49b6

Browse files
committed
test(cli): normalize path comparison in set-local test for Windows
set-local stores `path` via Path(...).as_posix() (matching bm project add and the rest of the codebase, which keep paths as POSIX strings). The test compared against str(Path), which on Windows produces backslashes and fails the equality check on the Windows CI runner. Use .as_posix() in the assertion so the test matches what the production code actually writes to config. Signed-off-by: phernandez <paul@basicmachines.co>
1 parent a42c6a2 commit 28c49b6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/cli/test_project_set_cloud_local.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,13 @@ def test_set_local_success(self, runner, mock_config, tmp_path):
169169
assert result.exit_code == 0
170170
assert "local mode" in result.stdout.lower()
171171

172-
# Verify config was updated — mode reset to local, path restored
172+
# Verify config was updated — mode reset to local, path restored.
173+
# set-local normalizes the path via Path.as_posix(), matching the
174+
# convention used by `bm project add`. On Windows that means
175+
# backslashes are converted to forward slashes.
173176
config_data = json.loads(mock_config.read_text())
174177
assert config_data["projects"]["research"]["mode"] == "local"
175-
assert config_data["projects"]["research"]["path"] == str(new_path)
178+
assert config_data["projects"]["research"]["path"] == new_path.as_posix()
176179

177180
def test_set_local_nonexistent_project(self, runner, mock_config):
178181
"""Test set-local with a project that doesn't exist in config."""

0 commit comments

Comments
 (0)