Browse Source

[UPD] latest cruft

master
Justin Lecher 2 days ago
parent
commit
c0b166bc7a
  1. 2
      .cruft.json
  2. 6
      hooks/pre_gen_project.py
  3. 4
      tests/test_all.py

2
.cruft.json

@ -1,6 +1,6 @@
{
"template": "git@git.ercpe.de:justin/cookiecutter-cookie.git",
"commit": "f0580cea84d52371582980b2bd3a46089009aadb",
"commit": "444986e99a37ddd4cd225f62af13b2c8ffde14d4",
"context": {
"cookiecutter": {
"full_name": "Justin Lecher",

6
hooks/pre_gen_project.py

@ -5,10 +5,10 @@ import sys
ROLE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"
ANSIBLE_COLLECTION = "{{ cookiecutter.ansible_collection }}"
TEST_VAR = "{{ cookiecutter.ansible_collection }}"
if not re.match(ROLE_REGEX, ANSIBLE_COLLECTION):
print(f"ERROR: '{ANSIBLE_COLLECTION}' is not a valid Python module name!")
if not re.match(ROLE_REGEX, TEST_VAR):
print(f"ERROR: '{TEST_VAR}' is not a valid Python module name!")
# exits with status 1 to indicate failure
sys.exit(1)

tests/test_bake_project.py → tests/test_all.py

@ -28,6 +28,8 @@ DIRS = (
"roles",
)
TEST_VAR = "ansible_collection"
@contextmanager
def inside_dir(dirpath):
@ -118,7 +120,7 @@ def test_make_help(cookies):
def test_bake_invalid_name(cookies):
bake_in_temp_dir(cookies, extra_context={"ansible_collection": "foo-bar"})
bake_in_temp_dir(cookies, extra_context={TEST_VAR: "foo-bar"})
def test_bake(cookies):
Loading…
Cancel
Save