fix: 清除硬编码API Key与机器特定路径,改用环境变量+混合式路径解析

This commit is contained in:
hangshuo652
2026-08-25 21:53:18 +08:00
parent b3895a905e
commit 8e81f960af
32 changed files with 200 additions and 76 deletions
+4 -4
View File
@@ -40,10 +40,10 @@ def test_normalize_injects_mapping_after_endsql(tmp_path):
assert "SQLCODE = -2067" in out
def test_normalize_mapping_before_if_sqlcode():
def test_normalize_mapping_before_if_sqlcode(tmp_path):
"""映射代码注入在 IF SQLCODE = -803 判断之前"""
r = _make_runner()
pp = Path(r'C:\Users\marye\AppData\Local\Temp\opencode\t3_pp.cbl')
pp = tmp_path / "t3_pp.cbl"
pp.parent.mkdir(parents=True, exist_ok=True)
pp.write_text(_pp_text_with_if(), encoding="utf-8")
r._patch_sqlcode_normalize(pp)
@@ -56,10 +56,10 @@ def test_normalize_mapping_before_if_sqlcode():
assert mapping_idx < if_idx
def test_normalize_does_not_change_ok_path():
def test_normalize_does_not_change_ok_path(tmp_path):
"""归一化不影响 SQLCODE=0 成功路径"""
r = _make_runner()
pp = Path(r'C:\Users\marye\AppData\Local\Temp\opencode\t3b_pp.cbl')
pp = tmp_path / "t3b_pp.cbl"
pp.write_text(_pp_text_with_if(), encoding="utf-8")
r._patch_sqlcode_normalize(pp)
out = pp.read_text(encoding="utf-8")