fix: mock config in test_init_defaults to test class-level defaults

The test_init_defaults test expected OperativeAgent class defaults
(temperature=0.3) but didn't mock load_config(), so when config loaded
successfully it returned the global default (0.7) instead.

Fix: mock load_config to raise, so the test properly validates the
class-level _default_temperature/max_tokens/max_turns fallback path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jon Saad-Falcon
2026-03-24 17:30:46 -07:00
co-authored by Claude Opus 4.6
parent 4ccec01784
commit 9dbd172950
+5 -1
View File
@@ -485,7 +485,11 @@ class TestOperativeAgent:
from openjarvis.agents.operative import OperativeAgent
engine = FakeEngine()
agent = OperativeAgent(engine, "test-model")
with patch(
"openjarvis.agents._stubs.load_config",
side_effect=Exception("no config"),
):
agent = OperativeAgent(engine, "test-model")
assert agent.agent_id == "operative"
assert agent._temperature == 0.3
assert agent._max_tokens == 2048