mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
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:
parent
4684aaffdc
commit
912efe11b5
1 changed files with 5 additions and 2 deletions
|
|
@ -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"}]}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue