Files
crewAI/lib/crewai-tools/tests/tools/test_directory_read_tool.py
2026-09-17 22:47:38 +05:30

22 lines
608 B
Python

from pathlib import Path
from crewai_tools.tools.directory_read_tool.directory_read_tool import (
DirectoryReadTool,
)
def test_lists_actual_path_when_descendant_repeats_base_path(
tmp_path: Path, monkeypatch
) -> None:
monkeypatch.chdir(tmp_path)
base = tmp_path / "workspace"
repeated = base / base.relative_to(base.anchor)
repeated.mkdir(parents=True)
target = repeated / "sentinel.txt"
target.write_text("content", encoding="utf-8")
result = DirectoryReadTool()._run(directory=str(base))
assert result == f"File paths: \n-{target}"
assert target.exists()