mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcb33e019a |
@@ -212,6 +212,10 @@ def project_sync(
|
||||
remote_path,
|
||||
"--filter-from",
|
||||
str(filter_path),
|
||||
"--header-download",
|
||||
"X-Tigris-Consistent: true",
|
||||
"--header-upload",
|
||||
"X-Tigris-Consistent: true",
|
||||
]
|
||||
|
||||
if verbose:
|
||||
@@ -287,6 +291,10 @@ def project_bisync(
|
||||
str(filter_path),
|
||||
"--workdir",
|
||||
str(state_path),
|
||||
"--header-download",
|
||||
"X-Tigris-Consistent: true",
|
||||
"--header-upload",
|
||||
"X-Tigris-Consistent: true",
|
||||
]
|
||||
|
||||
# Add --create-empty-src-dirs if rclone version supports it (v1.64+)
|
||||
@@ -356,6 +364,10 @@ def project_check(
|
||||
remote_path,
|
||||
"--filter-from",
|
||||
str(filter_path),
|
||||
"--header-download",
|
||||
"X-Tigris-Consistent: true",
|
||||
"--header-upload",
|
||||
"X-Tigris-Consistent: true",
|
||||
]
|
||||
|
||||
if one_way:
|
||||
@@ -393,6 +405,14 @@ def project_ls(
|
||||
if path:
|
||||
remote_path = f"{remote_path}/{path}"
|
||||
|
||||
cmd = ["rclone", "ls", remote_path]
|
||||
cmd = [
|
||||
"rclone",
|
||||
"ls",
|
||||
remote_path,
|
||||
"--header-download",
|
||||
"X-Tigris-Consistent: true",
|
||||
"--header-upload",
|
||||
"X-Tigris-Consistent: true",
|
||||
]
|
||||
result = run(cmd, capture_output=True, text=True, check=True)
|
||||
return result.stdout.splitlines()
|
||||
|
||||
@@ -130,6 +130,9 @@ def test_project_sync_success(tmp_path):
|
||||
assert "--filter-from" in cmd
|
||||
assert str(filter_path) in cmd
|
||||
assert "--dry-run" in cmd
|
||||
assert "--header-download" in cmd
|
||||
assert "X-Tigris-Consistent: true" in cmd
|
||||
assert "--header-upload" in cmd
|
||||
assert kwargs["text"] is True
|
||||
|
||||
|
||||
@@ -214,6 +217,9 @@ def test_project_bisync_success(tmp_path):
|
||||
assert "--compare=modtime" in cmd
|
||||
assert "--workdir" in cmd
|
||||
assert str(state_path) in cmd
|
||||
assert "--header-download" in cmd
|
||||
assert "X-Tigris-Consistent: true" in cmd
|
||||
assert "--header-upload" in cmd
|
||||
|
||||
|
||||
def test_project_bisync_requires_resync_first_time(tmp_path):
|
||||
@@ -369,6 +375,9 @@ def test_project_check_success(tmp_path):
|
||||
assert result is True
|
||||
cmd, kwargs = runner.calls[0]
|
||||
assert cmd[:2] == ["rclone", "check"]
|
||||
assert "--header-download" in cmd
|
||||
assert "X-Tigris-Consistent: true" in cmd
|
||||
assert "--header-upload" in cmd
|
||||
assert kwargs["capture_output"] is True
|
||||
assert kwargs["text"] is True
|
||||
|
||||
@@ -407,6 +416,10 @@ def test_project_ls_success():
|
||||
project = SyncProject(name="research", path="app/data/research")
|
||||
files = project_ls(project, "my-bucket", run=runner, is_installed=lambda: True)
|
||||
assert files == ["file1.md", "file2.md", "subdir/file3.md"]
|
||||
cmd, _ = runner.calls[0]
|
||||
assert "--header-download" in cmd
|
||||
assert "X-Tigris-Consistent: true" in cmd
|
||||
assert "--header-upload" in cmd
|
||||
|
||||
|
||||
def test_project_ls_with_subpath():
|
||||
|
||||
Reference in New Issue
Block a user