Merge branch 'fix/remove-cat-allowed-command'
This commit is contained in:
@@ -48,7 +48,6 @@ tools:
|
|||||||
- pytest
|
- pytest
|
||||||
- ruff
|
- ruff
|
||||||
- ls
|
- ls
|
||||||
- cat
|
|
||||||
- head
|
- head
|
||||||
- tail
|
- tail
|
||||||
- wc
|
- wc
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ from app.utils.display import (
|
|||||||
|
|
||||||
|
|
||||||
class TestRenderFunctions:
|
class TestRenderFunctions:
|
||||||
def test_render_user_message_returns_panel(self) -> None:
|
def test_render_user_message_returns_text(self) -> None:
|
||||||
result = render_user_message("hello")
|
result = render_user_message("hello")
|
||||||
assert isinstance(result, Panel)
|
assert isinstance(result, Text)
|
||||||
assert result.title == "You"
|
assert "hello" in result.plain
|
||||||
|
|
||||||
def test_render_assistant_message_returns_panel(self) -> None:
|
def test_render_assistant_message_returns_panel(self) -> None:
|
||||||
result = render_assistant_message("response")
|
result = render_assistant_message("response")
|
||||||
@@ -72,7 +72,7 @@ class TestDisplayAdapter:
|
|||||||
adapter.write_user_message("hello")
|
adapter.write_user_message("hello")
|
||||||
mock_log.write.assert_called_once()
|
mock_log.write.assert_called_once()
|
||||||
arg = mock_log.write.call_args[0][0]
|
arg = mock_log.write.call_args[0][0]
|
||||||
assert isinstance(arg, Panel)
|
assert isinstance(arg, Text)
|
||||||
|
|
||||||
def test_write_tool_call(self) -> None:
|
def test_write_tool_call(self) -> None:
|
||||||
mock_log = MagicMock()
|
mock_log = MagicMock()
|
||||||
|
|||||||
@@ -90,6 +90,6 @@ class TestRunCommandTool:
|
|||||||
# Create a file in the workspace to verify cwd
|
# Create a file in the workspace to verify cwd
|
||||||
(ws / "marker.txt").write_text("found")
|
(ws / "marker.txt").write_text("found")
|
||||||
tool = RunCommandTool(ws, cfg)
|
tool = RunCommandTool(ws, cfg)
|
||||||
result = tool.run("tc-9", {"command": "cat marker.txt"})
|
result = tool.run("tc-9", {"command": "head marker.txt"})
|
||||||
assert result.status == ToolResultStatus.SUCCESS
|
assert result.status == ToolResultStatus.SUCCESS
|
||||||
assert "found" in result.output
|
assert "found" in result.output
|
||||||
|
|||||||
Reference in New Issue
Block a user