forked from exercism/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaster_template.j2
More file actions
29 lines (24 loc) · 756 Bytes
/
master_template.j2
File metadata and controls
29 lines (24 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{%- import "generator_macros.j2" as macros with context -%}
{{ macros.canonical_ref() }}
{{ macros.header(imports=imports, ignore=ignore) }}
{%- macro test_cases_recursive(cases) -%}
{% for case in cases -%}
{% if "cases" in case %}
# {{ case["description"] }}
{{ test_cases_recursive(case["cases"]) }}
{% else %}
{{ test_case(case) }}
{% endif -%}
{% endfor -%}
{% endmacro %}
{% if not additional_tests -%}
{%- macro additional_tests() -%}
{{ test_cases_recursive(additional_cases) }}
{% endmacro %}
{%- endif %}
class {{ exercise | camel_case }}Test(unittest.TestCase):
{{ test_cases_recursive(cases) }}
{% if additional_cases | length -%}
# Additional tests for this track
{{ additional_tests() }}
{%- endif %}