feat(scenarios): 支持场景配置加载与首页展示
This commit is contained in:
30
tests/test_scenarios.py
Normal file
30
tests/test_scenarios.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import pytest
|
||||
|
||||
from apps.scenarios.services import (
|
||||
ScenarioNotFound,
|
||||
get_scenario,
|
||||
list_scenarios,
|
||||
)
|
||||
|
||||
|
||||
def test_list_scenarios_loads_five_configs():
|
||||
scenarios = list_scenarios()
|
||||
assert [scenario["id"] for scenario in scenarios] == [
|
||||
"document_review",
|
||||
"knowledge_qa",
|
||||
"quality_analysis",
|
||||
"risk_audit",
|
||||
"ticket_assistant",
|
||||
]
|
||||
|
||||
|
||||
def test_get_scenario_returns_full_agent_config():
|
||||
scenario = get_scenario("quality_analysis")
|
||||
assert scenario["agent"]["role"] == "质量管理专家"
|
||||
assert scenario["rag"]["enabled"] is True
|
||||
assert scenario["output"]["type"] == "quality_report"
|
||||
|
||||
|
||||
def test_get_scenario_raises_clear_error_for_missing_id():
|
||||
with pytest.raises(ScenarioNotFound, match="场景不存在"):
|
||||
get_scenario("missing")
|
||||
Reference in New Issue
Block a user