Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
34 lines
994 B
Python
34 lines
994 B
Python
"""Tests for task CRUD API endpoints."""
|
|
from app.models import Task
|
|
|
|
|
|
def test_update_task(client, db):
|
|
"""Create a task, update it, verify changes persisted."""
|
|
# 1. Create a task
|
|
response = client.post("/api/tasks", json={
|
|
"title": "Initial Task",
|
|
"description": "Initial description",
|
|
"priority": 3
|
|
})
|
|
assert response.status_code == 200
|
|
task_id = response.json()["task_id"]
|
|
|
|
# 2. Update title, description, and priority
|
|
update_data = {
|
|
"title": "Updated Task",
|
|
"description": "Updated description",
|
|
"priority": 1
|
|
}
|
|
|
|
response = client.put(f"/api/tasks/{task_id}", json=update_data)
|
|
|
|
# 3. Assert success
|
|
assert response.status_code == 200
|
|
assert response.json()["status"] == "success"
|
|
|
|
# 4. Verify in DB
|
|
task = db.query(Task).filter(Task.id == task_id).first()
|
|
assert task.title == "Updated Task"
|
|
assert task.description == "Updated description"
|
|
assert task.priority == 1
|