Skip to content

Commit 8a50df3

Browse files
committed
Added {{project_slug}} folder, added corresponding test functions
1 parent 0c61935 commit 8a50df3

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""Top-level package for {{ project_slug }}."""
4+
5+
__author__ = """{{ author }}"""
6+
__email__ = 'info@pyfar.org'
7+
__version__ = '{{ version }}'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Main module."""

tests/test_copier.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ def test_generated_file_exists(default_project, file_name):
1616
assert default_project.project_dir.joinpath(file_name).exists()
1717

1818

19+
@pytest.mark.parametrize("file_name", [
20+
"__init__.py",
21+
"my_project.py",
22+
])
23+
def test_generated_file_in_project_slug_exists(default_project, file_name):
24+
assert default_project.project_dir.joinpath('my_project').joinpath(
25+
file_name).exists()
26+
27+
1928
@pytest.mark.parametrize("desired", [
2029
"\nmy_project_description\n",
2130
"pip install my_project",
@@ -97,3 +106,14 @@ def test_incorrect_content_pyproject(default_project, not_desired):
97106
content = default_project.project_dir.joinpath(
98107
"pyproject.toml").read_text()
99108
assert not_desired not in content, f"{not_desired!r} is in content"
109+
110+
111+
@pytest.mark.parametrize("desired", [
112+
'Top-level package for my_project.',
113+
'__author__ = """The pyfar developers"""',
114+
"__version__ = '0.1.0'",
115+
])
116+
def test_content_project_slug_init(default_project, desired):
117+
content = default_project.project_dir.joinpath('my_project').joinpath(
118+
"__init__.py").read_text()
119+
assert desired in content, f"{desired!r} is not in content"

0 commit comments

Comments
 (0)