feat: API routes — speakers, rooms, search, RAG
Full implementations replacing stubs: speakers CRUD with utterance count, rooms list + mute/unmute via pipeline, FTS5-based search, RAG /ask and /summary endpoints. 15 route tests (8 new) all passing; 35 total. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
def test_list_rooms(api_client, seeded_db):
|
||||
resp = api_client.get("/api/rooms")
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert any(r["name"] == "Kitchen" for r in data)
|
||||
|
||||
|
||||
def test_mute_room_calls_pipeline(api_client, seeded_db, mocker):
|
||||
mock_post = mocker.patch("app.api.routes.rooms.httpx.post")
|
||||
mock_post.return_value.status_code = 200
|
||||
room = seeded_db.execute("SELECT id FROM rooms WHERE name='Kitchen'").fetchone()
|
||||
resp = api_client.post(f"/api/rooms/{room['id']}/mute")
|
||||
assert resp.status_code == 200
|
||||
mock_post.assert_called_once()
|
||||
Reference in New Issue
Block a user