Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/hermes_cli/test_runtime_provider_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ def test_resolve_runtime_provider_codex(monkeypatch):

def test_resolve_runtime_provider_qwen_oauth(monkeypatch):
monkeypatch.setattr(rp, "resolve_provider", lambda *a, **k: "qwen-oauth")
# This test exercises the singleton Qwen credential resolver, not the
# higher-priority credential pool. Keep it independent of any real
# ~/.qwen credentials present under the HOME preserved by the test runner.
monkeypatch.setattr(
rp,
"load_pool",
lambda _provider: SimpleNamespace(has_credentials=lambda: False),
)
monkeypatch.setattr(
rp,
"resolve_qwen_runtime_credentials",
Expand Down Expand Up @@ -363,6 +371,14 @@ def test_qwen_oauth_auto_fallthrough_on_auth_failure(monkeypatch):
from hermes_cli.auth import AuthError

monkeypatch.setattr(rp, "resolve_provider", lambda *a, **k: "qwen-oauth")
# A real Qwen pool entry would correctly win before the singleton resolver
# and prevent this auth-failure branch from running. Force the empty-pool
# precondition that this test is specifically asserting.
monkeypatch.setattr(
rp,
"load_pool",
lambda _provider: SimpleNamespace(has_credentials=lambda: False),
)
monkeypatch.setattr(
rp,
"resolve_qwen_runtime_credentials",
Expand Down