59014f6fe7
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>
19 lines
754 B
Python
19 lines
754 B
Python
def test_search_returns_matches(api_client, seeded_db):
|
|
room = seeded_db.execute("SELECT id FROM rooms WHERE name='Kitchen'").fetchone()
|
|
seeded_db.execute(
|
|
"INSERT INTO utterances (room_id, transcript, match_status, start_time, end_time) VALUES (?,?,?,?,?)",
|
|
(room["id"], "the grocery list is ready", "unknown", "2026-01-01 10:00:00", "2026-01-01 10:00:03"),
|
|
)
|
|
seeded_db.commit()
|
|
resp = api_client.get("/api/search?q=grocery")
|
|
assert resp.status_code == 200
|
|
data = resp.json()
|
|
assert len(data) == 1
|
|
assert "grocery" in data[0]["transcript"]
|
|
|
|
|
|
def test_search_no_results(api_client):
|
|
resp = api_client.get("/api/search?q=xyznotfound")
|
|
assert resp.status_code == 200
|
|
assert resp.json() == []
|