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

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