mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Fix variable name breakage (run_agent, hermes_constants, etc.) where import rewriter changed 'import X' to 'import hermes_agent.Y' but test code still referenced 'X' as a variable name. Fix package-vs-module confusion (cli.auth, cli.models, cli.ui) where single files became directories. Fix hardcoded file paths in tests pointing to old locations. Fix tool registry to discover tools in subpackage directories. Fix stale import in hermes_agent/tools/__init__.py. Part of #14182, #14183
21 lines
881 B
Python
21 lines
881 B
Python
from unittest.mock import MagicMock, patch
|
|
|
|
|
|
def test_gquota_uses_chat_console_when_tui_is_live():
|
|
from hermes_agent.providers.google_oauth import GoogleOAuthError
|
|
from hermes_agent.cli.repl import HermesCLI
|
|
|
|
cli = HermesCLI.__new__(HermesCLI)
|
|
cli.console = MagicMock()
|
|
cli._app = object()
|
|
|
|
live_console = MagicMock()
|
|
|
|
with patch("hermes_agent.cli.repl.ChatConsole", return_value=live_console), \
|
|
patch("hermes_agent.providers.google_oauth.get_valid_access_token", side_effect=GoogleOAuthError("No Google OAuth credentials found")), \
|
|
patch("hermes_agent.providers.google_oauth.load_credentials", return_value=None), \
|
|
patch("hermes_agent.providers.google_code_assist.retrieve_user_quota"):
|
|
cli._handle_gquota_command("/gquota")
|
|
|
|
assert live_console.print.call_count == 2
|
|
cli.console.print.assert_not_called()
|