2026-06-16 22:13:06 +00:00
|
|
|
|
"""conftest.py für helpers/tests/ – mockt helpers.tool, um plan_mode_guard-Tests
|
|
|
|
|
|
zu ermöglichen, ohne das Agent-Framework (helpers.tool → helpers.history → langchain.prompts)
|
|
|
|
|
|
laden zu müssen.
|
|
|
|
|
|
|
|
|
|
|
|
Wir mocken nur das minimale Tool/Response-Interface, das plan_mode_guard braucht.
|
|
|
|
|
|
"""
|
|
|
|
|
|
import sys
|
|
|
|
|
|
from types import SimpleNamespace
|
|
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
|
|
|
2026-06-17 23:33:57 +00:00
|
|
|
|
# Ensure /a0 is on sys.path so `usr.plugins...` imports resolve
|
|
|
|
|
|
if "/a0" not in sys.path:
|
|
|
|
|
|
sys.path.insert(0, "/a0")
|
|
|
|
|
|
|
2026-06-16 22:13:06 +00:00
|
|
|
|
|
|
|
|
|
|
# Minimal-Stubs für helpers.tool: Tool als leere Klasse, Response als SimpleNamespace
|
|
|
|
|
|
class _FakeResponse:
|
|
|
|
|
|
def __init__(self, message="", break_loop=False):
|
|
|
|
|
|
self.message = message
|
|
|
|
|
|
self.break_loop = break_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _FakeTool:
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_fake_tool_module = SimpleNamespace(Tool=_FakeTool, Response=_FakeResponse)
|
|
|
|
|
|
sys.modules["helpers.tool"] = _fake_tool_module
|