mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
test: set pool.provider= on mocks to avoid MagicMock truthy guard trigger
The provider-mismatch guard now checks pool_provider and current_provider != pool_provider. MagicMock.provider returns a truthy child mock by default, which would trigger the guard and skip the pool recovery tests. Set pool.provider='' explicitly.
This commit is contained in:
parent
2e30a5e628
commit
c2c73605e0
2 changed files with 6 additions and 0 deletions
|
|
@ -155,6 +155,9 @@ class TestPoolRotationCycle:
|
|||
|
||||
pool = MagicMock()
|
||||
pool.has_credentials.return_value = True
|
||||
# Must be set explicitly — MagicMock.provider returns a truthy
|
||||
# child mock, which would trigger the provider-mismatch guard.
|
||||
pool.provider = ""
|
||||
|
||||
# mark_exhausted_and_rotate returns next entry until exhausted
|
||||
self._rotation_index = 0
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ def _make_pool(entries):
|
|||
pool = MagicMock()
|
||||
pool.entries = entries
|
||||
pool.current.return_value = entries[0]
|
||||
# Must be set explicitly — MagicMock.provider returns a truthy
|
||||
# child mock, which would trigger the provider-mismatch guard.
|
||||
pool.provider = ""
|
||||
return pool
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue