fixing lint

This commit is contained in:
levxn
2026-03-18 02:15:58 +05:30
parent 2cd73dfccc
commit b799789dbe
2 changed files with 7 additions and 10 deletions
+3 -7
View File
@@ -1,9 +1,6 @@
"""Tests for AS-9: Skill directory allowlisting in file-read tool interception."""
import os
import tempfile
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock
from unittest.mock import MagicMock
import pytest
@@ -23,9 +20,8 @@ def _make_node(skill_dirs: list[str]):
"""Build a minimal EventLoopNode with skill_dirs set."""
from framework.graph.event_loop_node import EventLoopNode
node = EventLoopNode(
tool_executor=MagicMock(return_value=ToolResult(tool_use_id="tc-1", content="from-executor"))
)
mock_result = ToolResult(tool_use_id="tc-1", content="from-executor")
node = EventLoopNode(tool_executor=MagicMock(return_value=mock_result))
node._skill_dirs = skill_dirs
return node
+4 -3
View File
@@ -43,12 +43,13 @@ class TestSkillContentProtection:
conv = _make_conversation()
# Add many regular tool results to push over prune threshold
for i in range(30):
for _ in range(30):
await _add_tool_msg(conv, "x" * 500) # ~125 tokens each
# Add a skill content message
skill_msg = await _add_tool_msg(
conv, "## Deep Research\n" + "instructions " * 200,
conv,
"## Deep Research\n" + "instructions " * 200,
is_skill_content=True,
)
@@ -65,7 +66,7 @@ class TestSkillContentProtection:
"""Regular tool results are still pruned when over threshold."""
conv = _make_conversation()
for i in range(20):
for _ in range(20):
await _add_tool_msg(conv, "regular tool output " * 50)
pruned = await conv.prune_old_tool_results(protect_tokens=500, min_prune_tokens=100)