{%- import "generator_macros.j2" as macros with context -%}
{% macro test_case(case) -%}
    {%- set input = case["input"] -%}
    def test_{{ case["description"] | to_snake }}(self):
        self.assertIs(
            {{ case["property"] | to_snake }}("{{ case["input"]["sentence"].replace('"', '\\"') }}"),
            {{ case["expected"] }}
        )
{%- endmacro %}
{{ macros.header()}}

class {{ exercise | camel_case }}Test(unittest.TestCase):
    {# All test cases in this exercise are nested, so use two for loops -#}
    {% for case in cases -%}
    {{ test_case(case) }}
    {% endfor %}
    {% if additional_cases | length -%}

    # Additional tests for this track

    {% for case in additional_cases -%}
    {{ test_case(case) }}
    {% endfor %}
    {%- endif %}
{{ macros.footer() }}
