ai-memory-backend / tests /test_vfs_sync.py
Baida07's picture
sync: 181 file da Baida98/AI@0f8ce228 (2026-08-25 11:12 UTC) [deploy-all] (#38)
1282a69
Raw
History Blame Contribute Delete
750 Bytes
from api.vfs_sync import build_vfs_sync_complete
def test_vfs_sync_commit_includes_sorted_unique_files_after_success():
event = build_vfs_sync_complete(
"task-123",
{"reports/data.json", "e2e_metrics.json", "reports/data.json"},
{"success": True, "output": "ok"},
)
assert event == {
"taskId": "task-123",
"files": ["e2e_metrics.json", "reports/data.json"],
}
def test_vfs_sync_commit_is_omitted_without_files():
assert build_vfs_sync_complete("task-123", set(), {"success": True}) is None
def test_vfs_sync_commit_is_omitted_after_failed_loop():
assert build_vfs_sync_complete(
"task-123", {"e2e_metrics.json"}, {"success": False, "error": "write failed"}
) is None