feat(scenarios): 增强场景摘要与题型展示

This commit is contained in:
2026-05-30 00:33:34 +08:00
parent 81f17319ff
commit c57ab2f194
4 changed files with 36 additions and 2 deletions

View File

@@ -23,8 +23,18 @@ def test_get_scenario_returns_full_agent_config():
assert scenario["agent"]["role"] == "质量管理专家"
assert scenario["rag"]["enabled"] is True
assert scenario["output"]["type"] == "quality_report"
assert "质量异常分析" in scenario["applicable_questions"][0]
def test_get_scenario_raises_clear_error_for_missing_id():
with pytest.raises(ScenarioNotFound, match="场景不存在"):
get_scenario("missing")
def test_home_page_shows_applicable_questions(client):
response = client.get("/")
content = response.content.decode("utf-8")
assert response.status_code == 200
assert "适用题型" in content
assert "SOP 问答" in content