mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-25 05:52:34 +00:00
test(ci): stabilize shared optional dependency baselines
This commit is contained in:
parent
dd5a9502e3
commit
3c106c89a1
10 changed files with 194 additions and 70 deletions
|
|
@ -5,7 +5,7 @@ import threading
|
|||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from tools.registry import ToolRegistry, discover_builtin_tools
|
||||
from tools.registry import ToolRegistry, _module_registers_tools, discover_builtin_tools
|
||||
|
||||
|
||||
def _dummy_handler(args, **kwargs):
|
||||
|
|
@ -289,43 +289,19 @@ class TestCheckFnExceptionHandling:
|
|||
|
||||
|
||||
class TestBuiltinDiscovery:
|
||||
def test_matches_previous_manual_builtin_tool_set(self):
|
||||
expected = {
|
||||
"tools.browser_cdp_tool",
|
||||
"tools.browser_dialog_tool",
|
||||
"tools.browser_tool",
|
||||
"tools.clarify_tool",
|
||||
"tools.code_execution_tool",
|
||||
"tools.computer_use_tool",
|
||||
"tools.cronjob_tools",
|
||||
"tools.delegate_tool",
|
||||
"tools.discord_tool",
|
||||
"tools.feishu_doc_tool",
|
||||
"tools.feishu_drive_tool",
|
||||
"tools.file_tools",
|
||||
"tools.homeassistant_tool",
|
||||
"tools.image_generation_tool",
|
||||
"tools.kanban_tools",
|
||||
"tools.memory_tool",
|
||||
"tools.mixture_of_agents_tool",
|
||||
"tools.process_registry",
|
||||
"tools.rl_training_tool",
|
||||
"tools.send_message_tool",
|
||||
"tools.session_search_tool",
|
||||
"tools.skill_manager_tool",
|
||||
"tools.skills_tool",
|
||||
"tools.terminal_tool",
|
||||
"tools.todo_tool",
|
||||
"tools.tts_tool",
|
||||
"tools.vision_tools",
|
||||
"tools.web_tools",
|
||||
"tools.yuanbao_tools",
|
||||
}
|
||||
def test_discovers_all_real_self_registering_builtin_tool_modules(self):
|
||||
tools_dir = Path(__file__).resolve().parents[2] / "tools"
|
||||
expected = [
|
||||
f"tools.{path.stem}"
|
||||
for path in sorted(tools_dir.glob("*.py"))
|
||||
if path.name not in {"__init__.py", "registry.py", "mcp_tool.py"}
|
||||
and _module_registers_tools(path)
|
||||
]
|
||||
|
||||
with patch("tools.registry.importlib.import_module"):
|
||||
imported = discover_builtin_tools(Path(__file__).resolve().parents[2] / "tools")
|
||||
imported = discover_builtin_tools(tools_dir)
|
||||
|
||||
assert set(imported) == expected
|
||||
assert imported == expected
|
||||
|
||||
def test_imports_only_self_registering_modules(self, tmp_path):
|
||||
tools_dir = tmp_path / "tools"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue