This commit is contained in:
team3
2026-09-19 21:20:17 +02:00
parent a6cc15984f
commit a5b92054dc
7 changed files with 97 additions and 4 deletions

View File

@@ -9,4 +9,4 @@ DB_PATH = Path(os.getenv("DB_PATH", DATA_DIR / "desktop.db"))
# Jeder Client schickt diesen Token als "Authorization: Bearer <Token>"
SYNC_TOKEN = os.getenv("SYNC_TOKEN", "")
COLLECTIONS = ("events", "todos", "notes")
COLLECTIONS = ("events", "todos", "notes", "folders")

View File

@@ -32,6 +32,7 @@ class SyncIn(BaseModel):
events: list[dict] = []
todos: list[dict] = []
notes: list[dict] = []
folders: list[dict] = []
@app.get("/api/health")

View File

@@ -78,6 +78,13 @@ def test_tombstone(client):
assert client.get("/api/notes", headers=AUTH).json() == []
def test_ordner_laufen_mit(client):
r = sync(client, folders=[{"id": "Projekte/Alt", "updated": "2026-09-19T10:00:00.000Z", "deleted": False}])
assert r["folders"][0]["id"] == "Projekte/Alt"
r = sync(client, since=1, folders=[{"id": "Projekte/Alt", "updated": "2026-09-19T10:05:00.000Z", "deleted": True}])
assert r["folders"][0]["deleted"] is True
def test_seit_cursor_liefert_nur_neues(client):
sync(client, events=[{"id": "e1", "updated": "2026-09-19T10:00:00.000Z", "title": "a"}])
sync(client, events=[{"id": "e2", "updated": "2026-09-19T10:00:00.000Z", "title": "b"}])