Rebase onto upstream (a4d95fd) #12

Closed
wylab wants to merge 144 commits from rebase-onto-upstream into main
Showing only changes of commit e3ce706f65 - Show all commits
+25
View File
@@ -3,6 +3,7 @@
import pytest
from pathlib import Path
from nanobot.agent.tools.anthropic.edit import EditTool20250728
from nanobot.agent.tools.anthropic.base import CLIResult
@pytest.fixture
@@ -89,3 +90,27 @@ async def test_insert_command(edit_tool, temp_file):
content = temp_file.read_text()
lines = content.splitlines()
assert lines[1] == "inserted line"
@pytest.mark.asyncio
async def test_edit_tool_requires_absolute_path():
"""Test edit tool rejects relative paths."""
tool = EditTool20250728()
result = await tool(
command="view",
path="relative/path.txt"
)
assert isinstance(result, CLIResult)
assert result.exit_code == 1
assert "absolute" in result.error.lower()
def test_edit_tool_to_params():
"""Test edit tool returns correct params."""
tool = EditTool20250728()
params = tool.to_params()
assert params["type"] == "text_editor_20250728"
assert params["name"] == "str_replace_editor"