Skip to content

Commit 35698ac

Browse files
phernandezclaude
andcommitted
test: fix rclone command tests for path normalization
Update test expectations to match new path normalization behavior: - API returns normalized paths (without /app/data/ prefix) - get_project_remote() strips /app/data/ if present - Remote paths are now basic-memory-cloud:bucket/research instead of basic-memory-cloud:bucket/app/data/research This reflects the fix for path doubling bug where files were syncing to /app/data/app/data/project/. All 22 rclone tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 7b6a634 commit 35698ac

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

tests/test_rclone_commands.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,24 @@ def test_sync_project_optional_local_path():
4444

4545

4646
def test_get_project_remote():
47-
"""Test building rclone remote path."""
48-
project = SyncProject(name="research", path="app/data/research")
47+
"""Test building rclone remote path with normalized path."""
48+
# Path comes from API already normalized (no /app/data/ prefix)
49+
project = SyncProject(name="research", path="/research")
4950

5051
remote = get_project_remote(project, "my-bucket")
5152

52-
assert remote == "basic-memory-cloud:my-bucket/app/data/research"
53+
assert remote == "basic-memory-cloud:my-bucket/research"
5354

5455

55-
def test_get_project_remote_strips_leading_slash():
56-
"""Test that leading slash is stripped from cloud path."""
56+
def test_get_project_remote_strips_app_data_prefix():
57+
"""Test that /app/data/ prefix is stripped from cloud path."""
58+
# If API returns path with /app/data/, it should be stripped
5759
project = SyncProject(name="research", path="/app/data/research")
5860

5961
remote = get_project_remote(project, "my-bucket")
6062

61-
assert remote == "basic-memory-cloud:my-bucket/app/data/research"
63+
# Should strip /app/data/ prefix to get actual S3 path
64+
assert remote == "basic-memory-cloud:my-bucket/research"
6265

6366

6467
def test_get_project_bisync_state():
@@ -114,7 +117,7 @@ def test_project_sync_success(mock_run):
114117

115118
project = SyncProject(
116119
name="research",
117-
path="app/data/research",
120+
path="/research", # Normalized path from API
118121
local_sync_path="/tmp/research",
119122
)
120123

@@ -128,7 +131,7 @@ def test_project_sync_success(mock_run):
128131
assert cmd[0] == "rclone"
129132
assert cmd[1] == "sync"
130133
assert cmd[2] == "/tmp/research"
131-
assert cmd[3] == "basic-memory-cloud:my-bucket/app/data/research"
134+
assert cmd[3] == "basic-memory-cloud:my-bucket/research"
132135
assert "--dry-run" in cmd
133136

134137

@@ -341,9 +344,9 @@ def test_project_ls_with_subpath(mock_run):
341344
"""Test project ls with subdirectory."""
342345
mock_run.return_value = MagicMock(returncode=0, stdout="")
343346

344-
project = SyncProject(name="research", path="app/data/research")
347+
project = SyncProject(name="research", path="/research") # Normalized path
345348

346349
project_ls(project, "my-bucket", path="subdir")
347350

348351
cmd = mock_run.call_args[0][0]
349-
assert cmd[-1] == "basic-memory-cloud:my-bucket/app/data/research/subdir"
352+
assert cmd[-1] == "basic-memory-cloud:my-bucket/research/subdir"

0 commit comments

Comments
 (0)