mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-10-28 06:24:43 +00:00
fix: update ProactiveStep tests for string-based answer format
The proactive step answer was changed from dict to string in the previous commit. These tests now verify: - answer is a string (not dict) - answer contains expected text patterns (summary, topics, content) - metadata still carries structured data for programmatic consumers Refs #379
This commit is contained in:
parent
6145c568d3
commit
acd379d655
1 changed files with 10 additions and 16 deletions
|
|
@ -221,20 +221,12 @@ def test_proactive_answer_includes_topics_and_requested_content(tmp_path):
|
|||
)
|
||||
|
||||
assert response.success is True
|
||||
assert response.answer == {
|
||||
"summary": "Read 1 proactive topic(s) from daily/2026-05-28/interests.yaml",
|
||||
"topics": [
|
||||
{
|
||||
"title": "Retrieval quality",
|
||||
"reason": "Search behavior changed repeatedly.",
|
||||
"evidence": "daily/2026-05-28/session.md",
|
||||
"keywords": [],
|
||||
"paths": [],
|
||||
},
|
||||
],
|
||||
"content": content,
|
||||
}
|
||||
assert response.metadata["topics"] == response.answer["topics"]
|
||||
assert isinstance(response.answer, str)
|
||||
assert "Read 1 proactive topic(s) from daily/2026-05-28/interests.yaml" in response.answer
|
||||
assert "Topics:" in response.answer
|
||||
assert "Retrieval quality" in response.answer
|
||||
assert "Content:" in response.answer
|
||||
assert response.metadata["topics"][0]["title"] == "Retrieval quality"
|
||||
assert response.metadata["content"] == content
|
||||
|
||||
asyncio.run(run())
|
||||
|
|
@ -255,8 +247,10 @@ def test_proactive_answer_omits_unrequested_content(tmp_path):
|
|||
)
|
||||
|
||||
assert response.success is True
|
||||
assert "content" not in response.answer
|
||||
assert response.answer["topics"][0]["title"] == "Topic"
|
||||
assert isinstance(response.answer, str)
|
||||
assert "Content:" not in response.answer
|
||||
assert "Topics:" in response.answer
|
||||
assert "Topic" in response.answer
|
||||
assert response.metadata["content"] == ""
|
||||
|
||||
asyncio.run(run())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue