feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run

This commit is contained in:
CodexPi
2026-11-14 20:23:59 +01:00
commit 995b17a6e2
295 changed files with 36803 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
def test_project_activity_lists_only_running_projects(logged_in):
client, app, projects, _, headers = logged_in
active_root = projects / "active"
idle_root = projects / "idle"
active_root.mkdir()
idle_root.mkdir()
active = client.post("/api/projects", headers=headers, json={"name": "Active", "path": str(active_root)}).json()
idle = client.post("/api/projects", headers=headers, json={"name": "Idle", "path": str(idle_root)}).json()
conversation = client.post(
f"/api/projects/{active['id']}/conversations", headers=headers, json={"title": "Travail en cours"},
).json()
app.state.db.execute("UPDATE conversations SET status='running' WHERE id=?", (conversation["id"],))
response = client.get("/api/projects/activity")
assert response.status_code == 200
assert response.json() == {"running_project_ids": [active["id"]]}
assert idle["id"] not in response.json()["running_project_ids"]
def test_project_activity_requires_authentication(app_env):
client, *_ = app_env
assert client.get("/api/projects/activity").status_code == 401