{%- import "generator_macros.j2" as macros with context -%}
{{ macros.header() }}

class {{ exercise | camel_case }}Test(unittest.TestCase):
    {% for case in cases -%}
    {% set input = case["input"] -%}
    {% set expected = case["expected"] -%}
    def test_{{ case["description"] | to_snake }}(self):
        {% if expected["error"] -%}
        with self.assertRaises(ValueError) as err:
            {{ case["property"] }}("{{ input["series"] }}", {{ input["sliceLength"] }})
        self.assertEqual(type(err.exception), ValueError)
        self.assertEqual(err.exception.args[0], "{{ case["expected"]["error"] }}")
        {% else -%}
        self.assertEqual({{ case["property"] }}("{{ input["series"] }}", {{ input["sliceLength"] }}), {{ case["expected"] }})
        {% endif %}
    {% endfor %}
