test: 覆盖率提升至 100%(fail_under 90→99,13 个防御/边界用例)
This commit is contained in:
+11
-1
@@ -48,4 +48,14 @@ def test_env_placeholder_expansion(monkeypatch):
|
||||
def test_redacted_hides_secrets():
|
||||
s = Settings.from_dir(FIXTURES)
|
||||
red = s.get_redacted()
|
||||
assert red["rag"]["vector_store"]["qdrant"]["api_key"] == "***"
|
||||
assert red["rag"]["vector_store"]["qdrant"]["api_key"] == "***"
|
||||
|
||||
|
||||
def test_expand_env_list_branch(monkeypatch):
|
||||
# _expand_env 的 list 分支(L134):列表项递归展开环境占位
|
||||
from genesis.config import _expand_env
|
||||
monkeypatch.setenv("QDRANT_API_KEY", "sk-list-xyz")
|
||||
data = {"models": [{"name": "a", "key": "${QDRANT_API_KEY}"}, "plain"]}
|
||||
out = _expand_env(data)
|
||||
assert out["models"][0]["key"] == "sk-list-xyz"
|
||||
assert out["models"][1] == "plain"
|
||||
Reference in New Issue
Block a user