Skip to content

Commit de424fb

Browse files
committed
fix: use cross-platform path comparisons in Windows tests
- Use .as_posix() for path comparison (Windows uses backslashes) - Use Path.is_absolute() instead of checking for '/' prefix - Ensures tests pass on Windows, Linux, and macOS Signed-off-by: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent bc37ecf commit de424fb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/cli/test_project_add_with_local_path.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ def test_project_add_with_local_path_saves_to_config(
8888
# Verify config was updated
8989
config_data = json.loads(mock_config.read_text())
9090
assert "test-project" in config_data["cloud_projects"]
91-
assert config_data["cloud_projects"]["test-project"]["local_path"] == str(local_sync_dir)
91+
# Use as_posix() for cross-platform compatibility (Windows uses backslashes)
92+
assert config_data["cloud_projects"]["test-project"]["local_path"] == local_sync_dir.as_posix()
9293
assert config_data["cloud_projects"]["test-project"]["last_sync"] is None
9394
assert config_data["cloud_projects"]["test-project"]["bisync_initialized"] is False
9495

@@ -125,7 +126,8 @@ def test_project_add_local_path_expands_tilde(runner, mock_config, mock_api_clie
125126
# Verify config has expanded path
126127
config_data = json.loads(mock_config.read_text())
127128
local_path = config_data["cloud_projects"]["test-project"]["local_path"]
128-
assert local_path.startswith("/")
129+
# Path should be absolute (starts with / on Unix or drive letter on Windows)
130+
assert Path(local_path).is_absolute()
129131
assert "~" not in local_path
130132
assert local_path.endswith("/test-sync")
131133

0 commit comments

Comments
 (0)