Terminal / tests /test_vfs_sync.py
github-actions[bot]
Sync backend-only Space export 807f4ac8
c8365f5
Raw
History Blame
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