test(tools): cover eager deep-research registration

This commit is contained in:
Elliot Slusky
2026-08-09 22:59:45 -07:00
committed by Elliot Slusky
parent 3dc621618f
commit bcdbf13d02
+27
View File
@@ -3,6 +3,7 @@
from __future__ import annotations
import importlib
import subprocess
import sys
from openjarvis.core.registry import ToolRegistry
@@ -68,6 +69,10 @@ EXPECTED_TOOLS = {
"kg_add_relation",
"kg_query",
"kg_neighbors",
# knowledge_sql.py
"knowledge_sql",
# scan_chunks.py
"scan_chunks",
}
@@ -100,3 +105,25 @@ def test_all_builtin_tools_registered():
assert not missing, (
f"Tools not registered (missing import in __init__.py?): {sorted(missing)}"
)
def test_package_import_registers_deep_research_tools():
"""Registration must not depend on another module being imported first."""
result = subprocess.run(
[
sys.executable,
"-c",
(
"import openjarvis.tools; "
"from openjarvis.core.registry import ToolRegistry; "
"expected = {'knowledge_sql', 'scan_chunks'}; "
"missing = expected - set(ToolRegistry.keys()); "
"assert not missing, f'Missing tools: {sorted(missing)}'"
),
],
capture_output=True,
text=True,
check=False,
)
assert result.returncode == 0, result.stderr