test: keep the OPENAI .env fallback key OpenRouter-shaped

The sk-or- shape guard on unbound OPENAI_API_KEY (openrouter.ai context)
is deliberate: a real OpenAI key must never reach a third-party host.
The new fallback test used a neutral string, so the guard correctly
refused it. Make the fixture key sk-or- shaped so the test exercises the
fallback it means to.
This commit is contained in:
Brooklyn Nicholson
2026-10-02 20:22:34 -05:00
committed by brooklyn!
parent 0742b460a3
commit 00067849ce

View File

@@ -802,12 +802,12 @@ def test_openai_env_file_key_used_as_fallback_without_openrouter_key(monkeypatch
monkeypatch.delenv(oa_env_name, raising=False)
monkeypatch.delenv(or_env_name, raising=False)
monkeypatch.setattr(
"hermes_cli.config.load_env", lambda: {oa_env_name: "dotenv-openai-key"}
"hermes_cli.config.load_env", lambda: {oa_env_name: "sk-or-dotenv-openai-key"}
)
resolved = rp.resolve_runtime_provider(requested="openrouter")
assert resolved["api_key"] == "dotenv-openai-key"
assert resolved["api_key"] == "sk-or-dotenv-openai-key"
def test_custom_endpoint_uses_saved_config_base_url_when_env_missing(monkeypatch):