test(cli): isolate model picker Ollama probes

Fixes #30604
This commit is contained in:
Deepak Jain 2026-05-22 18:50:28 -07:00 committed by Teknium
parent 766c617e83
commit 1b56d0d1a2
2 changed files with 13 additions and 0 deletions

View file

@ -19,6 +19,12 @@ import pytest
from hermes_cli import model_switch
@pytest.fixture(autouse=True)
def _disable_live_custom_provider_model_probe(monkeypatch):
"""Keep custom-provider picker fixtures independent of local model servers."""
monkeypatch.setattr("hermes_cli.models.fetch_api_models", lambda *_a, **_kw: None)
def _make_provider(slug, name=None, models=None, *, is_current=False,
is_user_defined=False, source="built-in", api_url=None):
"""Build a dict shaped like ``list_authenticated_providers`` output."""

View file

@ -6,6 +6,7 @@ only looked at `providers:`.
"""
import hermes_cli.providers as providers_mod
import pytest
from hermes_cli.model_switch import list_authenticated_providers, switch_model
from hermes_cli.providers import resolve_provider_full
@ -18,6 +19,12 @@ _MOCK_VALIDATION = {
}
@pytest.fixture(autouse=True)
def _disable_live_custom_provider_model_probe(monkeypatch):
"""Keep custom-provider picker fixtures independent of local model servers."""
monkeypatch.setattr("hermes_cli.models.fetch_api_models", lambda *_a, **_kw: None)
def test_list_authenticated_providers_includes_custom_providers(monkeypatch):
"""No-args /model menus should include saved custom_providers entries."""
monkeypatch.setattr("agent.models_dev.fetch_models_dev", lambda: {})