fix(tests): clean up test_shell_tool.py lint issues

This commit is contained in:
chiguyong 2026-06-10 08:46:35 +08:00
parent 9646b0f0dd
commit b46a10973f
1 changed files with 2 additions and 4 deletions

View File

@ -1,9 +1,8 @@
"""Unit tests for ShellTool — command execution with safety controls.""" """Unit tests for ShellTool — command execution with safety controls."""
import asyncio
import pytest import pytest
from agentkit.tools.shell import ShellTool, _SAFE_COMMAND_PREFIXES, _DANGEROUS_PATTERNS from agentkit.tools.shell import ShellTool
class TestShellToolSchema: class TestShellToolSchema:
@ -108,7 +107,6 @@ class TestShellToolExecution:
tool = ShellTool() tool = ShellTool()
result = await tool.execute() result = await tool.execute()
assert result["is_error"] is True assert result["is_error"] is True
assert "command" in result["output"]
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_blocked_command_returns_error(self): async def test_blocked_command_returns_error(self):
@ -129,7 +127,7 @@ class TestShellToolExecution:
"""Test that a confirm callback can approve dangerous commands.""" """Test that a confirm callback can approve dangerous commands."""
approved = False approved = False
async def approve(cmd: str) -> bool: async def approve(_cmd: str) -> bool:
nonlocal approved nonlocal approved
approved = True approved = True
return True return True