mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
test(gateway): stub get_compression_tip in stale-guard db mock
The routing-heal added to get_or_create_session calls SessionDB.get_compression_tip; the stale-guard suite's bare MagicMock db returned a Mock the heal then assigned as session_id, failing JSON serialization. Model the real contract (a non-compressed session's tip is itself) so the heal is a correct no-op.
This commit is contained in:
parent
dfb28cc631
commit
c1e825399c
1 changed files with 4 additions and 0 deletions
|
|
@ -49,6 +49,10 @@ def _db_returning(rows: dict) -> MagicMock:
|
|||
db.find_latest_gateway_session_for_peer.return_value = None
|
||||
db.reopen_session.return_value = None
|
||||
db.create_session.return_value = None
|
||||
# No compression continuation → the tip is the session itself (identity),
|
||||
# mirroring the real SessionDB.get_compression_tip. Without this a bare Mock
|
||||
# would return a Mock the routing heal then assigns as session_id.
|
||||
db.get_compression_tip.side_effect = lambda sid: sid
|
||||
return db
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue