mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-11 00:22:29 +03:00
changed placeholder unit test to a script
This commit is contained in:
parent
366a722725
commit
61ddb4d121
|
@ -1,14 +1,12 @@
|
||||||
"""Unit tests for licenses"""
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
# script to check if licenses generated have placeholders not replaced with cookiecutter rendering
|
# script to check if licenses generated have placeholders not replaced with cookiecutter rendering
|
||||||
def test_scripts_for_placeholders():
|
def check_scripts_for_placeholders():
|
||||||
brackets = []
|
brackets = []
|
||||||
for filename in os.listdir('../{{cookiecutter.project_slug}}/licenses'):
|
for filename in os.listdir('../{{cookiecutter.project_slug}}/licenses'):
|
||||||
file = open('../{{cookiecutter.project_slug}}/licenses/' + filename, 'r', encoding="utf8")
|
file = open('../{{cookiecutter.project_slug}}/licenses/' + filename, 'r', encoding="utf8")
|
||||||
|
@ -35,3 +33,6 @@ def test_scripts_for_placeholders():
|
||||||
print()
|
print()
|
||||||
pprint(brackets)
|
pprint(brackets)
|
||||||
assert(len(brackets) == 0)
|
assert(len(brackets) == 0)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
check_scripts_for_placeholders()
|
Loading…
Reference in New Issue
Block a user