Files
Zhengshou Lai 69efc6b3e2 refactor(mytoolkit): 移除历史兼容,统一分层配置键,补全 Config 单测
- config.Config 仅支持 ~/.mytoolkit/config.json 分层键
- 删除旧 env.json/module-config.json 迁移逻辑与 flat-key 别名
- ssh/bib/image 命令改用 connections.* / paths.* / secrets.api_keys.*
- 单测覆盖分层读写、嵌套删除、export、resolve_key、权限
2026-07-19 11:56:26 +08:00

12 lines
359 B
Python

"""Pytest bootstrap: isolate tests from the real ~/.mytoolkit.
config.py and templates_registry.py resolve MYTOOLKIT_HOME at import time
and instantiate a module-level singleton, so the env var must be set before
any mytoolkit module is imported.
"""
import os
import tempfile
os.environ["MYTOOLKIT_HOME"] = tempfile.mkdtemp(prefix="mytoolkit-test-home-")