-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue-2-project-template' into sneridagh-misc-fixes
* issue-2-project-template: Remove trove classifier of distribution from project_settings Flag to add distribution trove classifier Backend: Update .dockerignore Apply suggestions from code review Fix Makefile and README Improve template testing with newer cookieplone version (0.7.0) Add dependabot.yml
- Loading branch information
Showing
45 changed files
with
261 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Test cookiecutter generation with distribution feature enabled.""" | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def cutter_result(cookies_session, context_distribution): | ||
"""Cookiecutter result.""" | ||
return cookies_session.bake(extra_context=context_distribution) | ||
|
||
|
||
def test_creation(cookies, context_distribution: dict): | ||
"""Generated project should match provided value.""" | ||
result = cookies.bake(extra_context=context_distribution) | ||
assert result.exception is None | ||
assert result.exit_code == 0 | ||
assert result.project_path.name == context_distribution["python_package_name"] | ||
assert result.project_path.is_dir() | ||
|
||
|
||
def test_variable_substitution(build_files_list, variable_pattern, cutter_result): | ||
"""Check if no file was unprocessed.""" | ||
paths = build_files_list(cutter_result.project_path) | ||
for path in paths: | ||
for line in open(path): | ||
match = variable_pattern.search(line) | ||
msg = f"cookiecutter variable not replaced in {path}" | ||
assert match is None, msg | ||
|
||
|
||
def test_trove_classifier_set(cutter_result): | ||
"""Check feature-specific files were not generated.""" | ||
trove_classifier = "Framework :: Plone :: Distribution" | ||
setup_py = cutter_result.project_path / "setup.py" | ||
assert trove_classifier in setup_py.read_text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ALLOWED_MISSING = [] | ||
ALLOWED_NOT_USED = [] | ||
|
||
|
||
def test_no_missing_variables(variables_missing): | ||
"""Test no variable is missing from cookiecutter.json""" | ||
assert len(variables_missing) == len(ALLOWED_MISSING) | ||
assert variables_missing == ALLOWED_MISSING | ||
|
||
|
||
def test_not_used_variables(variables_not_used): | ||
"""Test variables are used.""" | ||
assert len(variables_not_used) == len(ALLOWED_NOT_USED) | ||
assert variables_not_used == ALLOWED_NOT_USED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...{ cookiecutter.__package_namespace }}/{{ cookiecutter.__package_name }}/dependencies.zcml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ALLOWED_MISSING = [] | ||
ALLOWED_NOT_USED = [] | ||
|
||
|
||
def test_no_missing_variables(variables_missing): | ||
"""Test no variable is missing from cookiecutter.json""" | ||
assert len(variables_missing) == len(ALLOWED_MISSING) | ||
assert variables_missing == ALLOWED_MISSING | ||
|
||
|
||
def test_not_used_variables(variables_not_used): | ||
"""Test variables are used.""" | ||
assert len(variables_not_used) == len(ALLOWED_NOT_USED) | ||
assert variables_not_used == ALLOWED_NOT_USED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.