Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions tests/test_generated_project_root.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from __future__ import annotations

from tests.utils import run_within_dir


def test_full_structure(cookies, tmp_path):
"""
Test to verify the correct structure of a generated project.

The test checks that all expected files and directories exist in the
generated project directory and that the project creation process
completes without errors.
"""

expected_files = [
".devcontainer",
".github",
".gitignore",
".pre-commit-config.yaml",
"CONTRIBUTING.md",
"Dockerfile",
"LICENSE",
"Makefile",
"README.md",
"codecov.yaml",
"docs",
"example_project",
"mkdocs.yml",
"pyproject.toml",
"tests",
"tox.ini",
]

with run_within_dir(tmp_path):
result = cookies.bake()

# Check that all expected files and folders are present
for file in expected_files:
file_path = result.project_path / file
assert file_path.exists(), f"Missing file or folder: {file_path}"

# Final assertions
assert result.exit_code == 0
assert result.exception is None
Loading