fix(tests): add content attribute to fake result objects

_FakeReadResult and _FakeSearchResult now expose the attributes
that read_file_tool/search_tool access after the redact_sensitive_text
integration from main.
This commit is contained in:
0xbyt4
2026-03-09 13:25:52 +03:00
parent 4684aaffdc
commit 912efe11b5

View File

@@ -29,11 +29,11 @@ from tools.file_tools import (
class _FakeReadResult:
"""Minimal stand-in for FileOperations.read_file return value."""
def __init__(self, content="line1\nline2\n", total_lines=2):
self._content = content
self.content = content
self._total_lines = total_lines
def to_dict(self):
return {"content": self._content, "total_lines": self._total_lines}
return {"content": self.content, "total_lines": self._total_lines}
def _fake_read_file(path, offset=1, limit=500):
@@ -42,6 +42,9 @@ def _fake_read_file(path, offset=1, limit=500):
class _FakeSearchResult:
"""Minimal stand-in for FileOperations.search return value."""
def __init__(self):
self.matches = []
def to_dict(self):
return {"matches": [{"file": "test.py", "line": 1, "text": "match"}]}