mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-05 07:41:39 +00:00
fix(auth): refresh Nous entitlement in tool menus
This commit is contained in:
parent
406901b27d
commit
1cf5e639b3
8 changed files with 304 additions and 108 deletions
|
|
@ -71,6 +71,26 @@ class TestManagedNousToolsEnabled:
|
|||
)
|
||||
assert managed_nous_tools_enabled() is True
|
||||
|
||||
def test_force_fresh_is_forwarded(self, monkeypatch):
|
||||
calls = []
|
||||
|
||||
def fake_account_info(*, force_fresh=False):
|
||||
calls.append(force_fresh)
|
||||
return NousPortalAccountInfo(
|
||||
logged_in=True,
|
||||
source="account_api",
|
||||
fresh=True,
|
||||
paid_service_access=True,
|
||||
)
|
||||
|
||||
monkeypatch.setattr(
|
||||
"hermes_cli.nous_account.get_nous_portal_account_info",
|
||||
fake_account_info,
|
||||
)
|
||||
|
||||
assert managed_nous_tools_enabled(force_fresh=True) is True
|
||||
assert calls == [True]
|
||||
|
||||
def test_returns_false_on_exception(self, monkeypatch):
|
||||
"""Should never crash — returns False on any exception."""
|
||||
monkeypatch.setattr(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue