- config.Config 仅支持 ~/.mytoolkit/config.json 分层键 - 删除旧 env.json/module-config.json 迁移逻辑与 flat-key 别名 - ssh/bib/image 命令改用 connections.* / paths.* / secrets.api_keys.* - 单测覆盖分层读写、嵌套删除、export、resolve_key、权限
12 lines
359 B
Python
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-")
|