Skip to content

Commit 0ad24ea

Browse files
committed
fix(test): 固定 api.enabled 为 True 避免测试继承本地配置
1 parent 205310c commit 0ad24ea

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎tests/test_claude_sync.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ def setUp(self) -> None:
6464
self.platform_cfg = json.loads(
6565
(REPO_ROOT / "env" / "platforms" / "claude.json").read_text()
6666
)
67+
# api.enabled is a user-configurable local toggle, not a fixed schema
68+
# value — pin the fixture baseline to enabled=True so tests don't
69+
# silently inherit whatever value happens to be committed in
70+
# env/platforms/claude.json. Tests that need the disabled path set
71+
# cfg["api"] = {"enabled": False} explicitly.
72+
self.platform_cfg["api"] = {"enabled": True}
6773

6874
# Seed env/mcp/ with a sample server
6975
self._write_json(

‎tests/test_gemini_sync.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ def setUp(self) -> None:
4848
self.platform_cfg = json.loads(
4949
(REPO_ROOT / "env" / "platforms" / "gemini.json").read_text()
5050
)
51+
# api.enabled is a user-configurable local toggle, not a fixed schema
52+
# value — pin the fixture baseline to enabled=True so tests don't
53+
# silently inherit whatever value happens to be committed in
54+
# env/platforms/gemini.json. Tests that need the disabled path set
55+
# cfg["api"] = {"enabled": False} explicitly.
56+
self.platform_cfg["api"] = {"enabled": True}
5157
self._write_json(
5258
self.root / "env" / "mcp" / "sample.json",
5359
{

0 commit comments

Comments
 (0)