mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-09-20 18:13:49 +00:00
Co-authored-by: gaoanze <gaoanze@meituan.com> Co-authored-by: Vidit Ostwal <110953813+Vidit-Ostwal@users.noreply.github.com>
22 lines
608 B
Python
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()
|