test(gmi): stub profile fetch_models in static-fallback test

The fallback test only mocked fetch_api_models; CI still hit the real GMI
/v1/models endpoint via ProviderProfile.fetch_models and merged live
models into the result.
This commit is contained in:
Brooklyn Nicholson 2026-06-28 18:05:28 -05:00
parent 27f03243a0
commit f34cf7e3a4

View file

@ -118,6 +118,12 @@ class TestGmiModelCatalog:
},
)
monkeypatch.setattr("hermes_cli.models.fetch_api_models", lambda api_key, base_url: None)
# Generic profile path uses ProviderProfile.fetch_models (urllib), not
# fetch_api_models — must stub it or CI can hit the real endpoint.
monkeypatch.setattr(
"providers.base.ProviderProfile.fetch_models",
lambda self, *, api_key=None, base_url=None, timeout=8.0: None,
)
assert provider_model_ids("gmi") == list(_PROVIDER_MODELS["gmi"])