Mercurial > hg > MakeItSo
comparison tests/test_included.py @ 258:e21f013586d0
get variables and feed them right back
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Sat, 27 May 2017 15:23:44 -0700 |
| parents | 28d76b139fdd |
| children | 15ade7ad64da |
comparison
equal
deleted
inserted
replaced
| 257:28d76b139fdd | 258:e21f013586d0 |
|---|---|
| 2 tests for templates included in the package | 2 tests for templates included in the package |
| 3 """ | 3 """ |
| 4 | 4 |
| 5 included_templates = set(['python-package']) | 5 included_templates = set(['python-package']) |
| 6 | 6 |
| 7 import tempfile | |
| 7 from makeitso.makeitso import get_entry_points | 8 from makeitso.makeitso import get_entry_points |
| 8 | 9 |
| 9 def test_included_template(): | 10 def test_included_template(): |
| 10 """ensure we are packaging included template correctly""" | 11 """ensure we are packaging included template correctly""" |
| 11 | 12 |
| 12 # ensure template is present in entry points | 13 # ensure template is present in entry points |
| 13 entry_points = get_entry_points() | 14 entry_points = get_entry_points() |
| 14 assert included_templates.issubset(entry_points) | 15 assert included_templates.issubset(entry_points) |
| 16 | |
| 17 # render each template | |
| 18 for template_name in included_templates: | |
| 19 template = entry_points[template_name]() | |
| 20 | |
| 21 # get the variables | |
| 22 missing = template.missing() | |
| 23 variables = {variable: variable | |
| 24 for variable in missing} | |
| 25 |
