- 工作区内部路径 .agents/ -> .astrion/ - 默认运行态数据根 ~/.agents/agents/ -> ~/.astrion/astrion/ - 环境变量 AGENTS_DATA_ROOT -> ASTRION_DATA_ROOT(无兼容) - 同步更新代码、测试、文档与脚本中的路径引用 - 新增 .gitignore 忽略 .astrion/ 与 .agents/ 运行态目录
30 lines
1002 B
Python
30 lines
1002 B
Python
import unittest
|
||
|
||
from utils.tool_result_formatter import format_tool_result_for_context
|
||
|
||
|
||
class ToolResultFormatterTest(unittest.TestCase):
|
||
def test_read_skill_formats_full_read_content_like_read_file(self):
|
||
result = {
|
||
"success": True,
|
||
"type": "read",
|
||
"path": ".astrion/skills/frontend-design/SKILL.md",
|
||
"max_chars": 50000,
|
||
"truncated": False,
|
||
"content": "# Skill\nFull content",
|
||
"line_start": 1,
|
||
"line_end": 2,
|
||
"total_lines": 2,
|
||
"message": "已读取 .astrion/skills/frontend-design/SKILL.md 的内容(行 1~2)",
|
||
}
|
||
|
||
formatted = format_tool_result_for_context("read_skill", result)
|
||
|
||
self.assertIn("读取 .astrion/skills/frontend-design/SKILL.md 行 1~2", formatted)
|
||
self.assertIn("```\n# Skill\nFull content\n```", formatted)
|
||
self.assertNotEqual(result["message"], formatted)
|
||
|
||
|
||
if __name__ == "__main__":
|
||
unittest.main()
|