fix: 数据源审查小修(from_config 类型守卫/PROMPTS_KEYS 消重/契约措辞)
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -153,6 +153,14 @@ def test_from_config_non_string_key_raises():
|
||||
"extractor": "e", "evaluator": "v"})
|
||||
|
||||
|
||||
def test_from_config_non_dict_raises():
|
||||
# 入口类型守卫: Task 6 的 PUT prompts 会把请求体直传这里——字符串/
|
||||
# 列表进来必须是 ValueError,不能让 .get 的 AttributeError 漏成 500
|
||||
for bad in ("system=...", ["system", "company_facts"], 42, None):
|
||||
with pytest.raises(ValueError, match="dict"):
|
||||
PromptProvider.from_config(bad)
|
||||
|
||||
|
||||
def test_from_config_equals_from_dir():
|
||||
d = JC_PROMPTS
|
||||
cfg = {name: (d / f"{name}.md").read_text(encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user