Skip to content

Commit dbabda2

Browse files
authored
add module test_generated_project_root (#56)
1 parent 48a3d75 commit dbabda2

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from __future__ import annotations
2+
3+
from tests.utils import run_within_dir
4+
5+
6+
def test_full_structure(cookies, tmp_path):
7+
"""
8+
Test to verify the correct structure of a generated project.
9+
10+
The test checks that all expected files and directories exist in the
11+
generated project directory and that the project creation process
12+
completes without errors.
13+
"""
14+
15+
expected_files = [
16+
".devcontainer",
17+
".github",
18+
".gitignore",
19+
".pre-commit-config.yaml",
20+
"CONTRIBUTING.md",
21+
"Dockerfile",
22+
"LICENSE",
23+
"Makefile",
24+
"README.md",
25+
"codecov.yaml",
26+
"docs",
27+
"example_project",
28+
"mkdocs.yml",
29+
"pyproject.toml",
30+
"tests",
31+
"tox.ini",
32+
]
33+
34+
with run_within_dir(tmp_path):
35+
result = cookies.bake()
36+
37+
# Check that all expected files and folders are present
38+
for file in expected_files:
39+
file_path = result.project_path / file
40+
assert file_path.exists(), f"Missing file or folder: {file_path}"
41+
42+
# Final assertions
43+
assert result.exit_code == 0
44+
assert result.exception is None

0 commit comments

Comments
 (0)