* Corrected small typos around resistor bands. * Due to failing CI, alterations to the test generator script were needed. The generated vs submitted diff now skips the first three lines of the file so that the generation date is not picked up and flagged as needing regeneration. Sadly, a workaround was also needed to prevent Python difflib from noting the difference anyways and producing an empty "false positive" diff. All templates and test files also needed to be altered to ensure that the first three lines of every test file will always be the autogeneration comment and date. Hopefully, this will now stop the CI failures without creating any subtle additional bugs. * Touch up to bowling template. Added back the error raising utility. * Touch up to two-bucket template to add back in error raising utility. [no important files changed]
30 lines
756 B
Django/Jinja
30 lines
756 B
Django/Jinja
{%- 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 %}
|