from pathlib import Path


def directory_tree(tmp_path, directory_tree_files) -> Path:
    """Create a test directory tree."""
    # initialize
    base = tmp_path / "directory_tree"
    for path in directory_tree_files:
        path = base / path
        path.parent.mkdir(parents=True, exist_ok=True)

        if str(path).endswith("file1"):
            path.write_text("123")
        elif str(path).endswith("file2"):
            path.write_text("456")
        elif str(path).endswith("file3"):
            path.write_text("789")

    return base