mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-30 19:09:28 +00:00
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:
parent
353578faca
commit
754fdbdc98
1 changed files with 4 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue