mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-19 15:18:03 +00:00
fix(tests): patch catalog urlopen wrapper in gemini probe tests (#64318)
test_probe_sends_client_context_to_gemini and
test_probe_omits_gemini_client_context_for_other_providers (added in
b8eb89f5c) patch hermes_cli.models.urllib.request.urlopen, but
probe_api_models routes requests through the
_urlopen_model_catalog_request wrapper (open_credentialed_url from the
urllib_security hardening), so the mock is never invoked and
mock_urlopen.call_args is None -> TypeError. Every CI run on main and
every PR has been failing test slice 7/8 on these two tests.
Point the patches at _urlopen_model_catalog_request, the same target
every sibling test in TestProbeApiModelsUserAgent already uses.
89/89 tests in the file now pass.
This commit is contained in:
parent
226e8de827
commit
0d3ad193d6
1 changed files with 2 additions and 2 deletions
|
|
@ -949,7 +949,7 @@ class TestProbeApiModelsUserAgent:
|
|||
|
||||
body = b'{"data":[]}'
|
||||
with patch(
|
||||
"hermes_cli.models.urllib.request.urlopen",
|
||||
"hermes_cli.models._urlopen_model_catalog_request",
|
||||
return_value=self._make_mock_response(body),
|
||||
) as mock_urlopen:
|
||||
probe_api_models(
|
||||
|
|
@ -965,7 +965,7 @@ class TestProbeApiModelsUserAgent:
|
|||
|
||||
body = b'{"data":[]}'
|
||||
with patch(
|
||||
"hermes_cli.models.urllib.request.urlopen",
|
||||
"hermes_cli.models._urlopen_model_catalog_request",
|
||||
return_value=self._make_mock_response(body),
|
||||
) as mock_urlopen:
|
||||
probe_api_models("provider-key", "https://api.example.com/v1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue