test: set HERMES_HOME in _persist_model_switch tests after save_config_value fix

The prior commit made save_config_value resolve its target via
get_hermes_home() (live env) instead of the import-time cli._hermes_home
constant. Two _persist_model_switch tests patched only cli._hermes_home
and wrote/read tmp_path/config.yaml, so the write now landed in the real
HERMES_HOME and the readback saw stale values. Set HERMES_HOME=tmp_path
(kept the _hermes_home patch for belt-and-suspenders). No production
change.
This commit is contained in:
Teknium 2026-07-28 10:52:28 -07:00
parent 353578faca
commit 754fdbdc98
No known key found for this signature in database

View file

@ -13944,9 +13944,9 @@ def test_persist_model_switch_preserves_sibling_model_keys(tmp_path, monkeypatch
"agent:\n"
" system_prompt: keepme\n"
)
# save_config_value() resolves the config path from cli._hermes_home, which
# is captured at import time — patch it directly (set_hermes_home_override
# does NOT affect this snapshot).
# save_config_value() resolves the config path from get_hermes_home() (live
# env var), always targeting HERMES_HOME/config.yaml — point it at tmp_path.
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
monkeypatch.setattr(cli, "_hermes_home", tmp_path)
result = types.SimpleNamespace(
@ -13979,6 +13979,7 @@ def test_persist_model_switch_clears_stale_base_url(tmp_path, monkeypatch):
" provider: custom:mylocal\n"
" base_url: http://localhost:1234/v1\n"
)
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
monkeypatch.setattr(cli, "_hermes_home", tmp_path)
# Switch to a native provider with no base_url.