fix: cross-platform test compatibility

- test_channel_plugins: fix assertion logic for discoverable channels
- test_filesystem_tools: normalize path separators for Windows
- test_tool_validation: use python to generate output, avoid cmd line limits
This commit is contained in:
chengyongru
2026-03-14 02:03:15 +08:00
committed by Xubin Ren
parent dbdb43faff
commit 91d95f139e
3 changed files with 14 additions and 7 deletions

View File

@@ -379,9 +379,11 @@ async def test_exec_always_returns_exit_code() -> None:
async def test_exec_head_tail_truncation() -> None:
"""Long output should preserve both head and tail."""
tool = ExecTool()
# Generate output that exceeds _MAX_OUTPUT
big = "A" * 6000 + "\n" + "B" * 6000
result = await tool.execute(command=f"echo '{big}'")
# Generate output that exceeds _MAX_OUTPUT (10_000 chars)
# Use python to generate output to avoid command line length limits
result = await tool.execute(
command="python -c \"print('A' * 6000 + '\\n' + 'B' * 6000)\""
)
assert "chars truncated" in result
# Head portion should start with As
assert result.startswith("A")