Skip to content

Commit a6d1a04

Browse files
authored
Update test_agent_misc.py
1 parent 65ec95a commit a6d1a04

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

‎tests/agent/test_agent_misc.py‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,31 @@ def test_bad_command_returns_error_string_not_pending(self):
127127
from python_agent_harness.tools.bash import Bash
128128

129129
# Popen with shell=True never fails on syntax; simulate the
130-
# OSError path via an impossible cwd instead
130+
# OSError path via an impossible cwd instead. The double
131+
# implements the full ToolRuntime surface (Bash only reads
132+
# project_dir/cancel_event) so ToolContext proxies without any
133+
# hasattr guard.
131134
class FakeSess:
132135
project_dir = "/nonexistent-pah-dir"
136+
cancel_event = threading.Event()
137+
138+
def ask_questions(self, questions: list[dict]) -> str:
139+
return "answer"
140+
141+
def record_diff(self, diff_text: str) -> None:
142+
pass
143+
144+
def update_todos(self, todos: list[dict]) -> None:
145+
pass
146+
147+
def find_skill(self, name: str) -> str | None:
148+
return None
149+
150+
def run_subagent(self, subagent_type: str, description: str, prompt: str) -> str:
151+
return f"ran {description}"
152+
153+
def plan_exit(self) -> str:
154+
return "approved"
133155

134156
result = Bash().run({"command": "echo hi"}, ToolContext(FakeSess()))
135157
self.assertIsInstance(result, str)

0 commit comments

Comments
 (0)