From 9d9cdcf43322601160ad2655333a9a961b2008ae Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 18 Dec 2024 10:26:07 +0000 Subject: [PATCH] Add a tests for different package / module name --- tests/conftest.py | 4 +++- tests/test_hooks.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 42bfa9b..6d3f32d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -65,7 +65,9 @@ def bake_examples(cookies): """ Examples on. """ - result = cookies.bake(extra_context={"include_example_code": "y", + result = cookies.bake(extra_context={"package_name": "example-package", + "module_name": "example_package", + "include_example_code": "y", "author_name": "test", "use_extended_ruff_linting": "y"}) return _handle_cookiecutter_errors(result) diff --git a/tests/test_hooks.py b/tests/test_hooks.py index f5b1950..a1f4267 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -37,7 +37,7 @@ def test_examples_present(cookiejar_examples): example_files.append("example_c.pyx") for afile in example_files: - assert (cj.project_path / ctx['package_name'] / afile).exists() + assert (cj.project_path / ctx['module_name'] / afile).exists() @pytest.mark.parametrize("license, lfile", [