test(backend): update query tests for sub-question generation (sub-phase 2.3)

Update prompt assertion in decomposer test and field assertions in query endpoint tests to match extracted_questions rename.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Woody 2026-04-24 16:24:10 +08:00
parent f9dda7bd18
commit 51640201f3
2 changed files with 4 additions and 4 deletions

View File

@ -49,8 +49,8 @@ class TestQuery:
assert response.status_code == 200 assert response.status_code == 200
data = response.json() data = response.json()
assert "keywords" in data assert "extracted_questions" in data
assert data["keywords"] == ["test", "keywords"] assert data["extracted_questions"] == ["test", "keywords"]
assert "answer" in data assert "answer" in data
assert "- Bullet point answer" in data["answer"] assert "- Bullet point answer" in data["answer"]
assert "sources" in data assert "sources" in data
@ -84,7 +84,7 @@ class TestQuery:
assert response.status_code == 200 assert response.status_code == 200
data = response.json() data = response.json()
assert data["keywords"] == ["test"] assert data["extracted_questions"] == ["test"]
assert "could not find" in data["answer"].lower() assert "could not find" in data["answer"].lower()
assert data["sources"] == [] assert data["sources"] == []

View File

@ -25,7 +25,7 @@ async def test_decompose_valid_json():
decomposer = QueryDecomposer(llm) decomposer = QueryDecomposer(llm)
result: List[str] = await decomposer.decompose("What are keywords for X?") result: List[str] = await decomposer.decompose("What are keywords for X?")
assert result == ["alpha", "beta", "gamma"] assert result == ["alpha", "beta", "gamma"]
assert llm.last_prompt == "Given question: 'What are keywords for X?', extract key search keywords as JSON array" assert llm.last_prompt == "Given this question: 'What are keywords for X?'\n\nBreak it down into 2-5 simplified sub-questions that would help search for relevant information. Each sub-question should be short and focused on one aspect. Return as a JSON array of strings."
async def test_decompose_empty_question_returns_empty(): async def test_decompose_empty_question_returns_empty():