Files
wehub-resource-sync 2c632336aa
CI / Viewer CI (push) Successful in 13m37s
CI / Core CI (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:32:38 +08:00

28 lines
853 B
Python

from __future__ import annotations
from articraft.config import bootstrap_env
def test_bootstrap_env_imports_generation_defaults(tmp_path) -> None:
(tmp_path / ".env.example").write_text(
"ARTICRAFT_MODEL=\nARTICRAFT_THINKING_LEVEL=\nARTICRAFT_MAX_COST_USD=\n",
encoding="utf-8",
)
values = {
"ARTICRAFT_MODEL": "gpt-5.5",
"ARTICRAFT_THINKING_LEVEL": "xhigh",
"ARTICRAFT_MAX_COST_USD": "1.25",
}
created, imported_keys = bootstrap_env(tmp_path, environ=values)
assert created is True
assert imported_keys == [
"ARTICRAFT_MODEL",
"ARTICRAFT_THINKING_LEVEL",
"ARTICRAFT_MAX_COST_USD",
]
assert (tmp_path / ".env").read_text(encoding="utf-8") == (
"ARTICRAFT_MODEL=gpt-5.5\nARTICRAFT_THINKING_LEVEL=xhigh\nARTICRAFT_MAX_COST_USD=1.25\n"
)