Skip to content

Commit 2e58919

Browse files
meatball133BethanyG
authored andcommitted
removed 3 lines
1 parent 2fba891 commit 2e58919

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

exercises/practice/linked-list/.meta/template.j2

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
{%- set error_operation = inputs[-1]["operation"] -%}
1010
{% endif %}
1111
{%- if case["expected"] and inputs|length > 1 -%}
12-
{%- set final = inputs[-1]["operation"] -%}
1312
{%- set inputs = inputs[:-1] -%}
1413
{%- elif case["expected"] -%}
15-
{%- set final = inputs[-1]["operation"] -%}
16-
{%- set inputs = [{"operation": "None"}] -%}
14+
{%- set inputs = [] -%}
1715
{%- endif -%}
1816
{%- for input in inputs -%}
1917
{%- set operation = input["operation"] -%}
@@ -34,17 +32,16 @@
3432
{%- endif %}
3533
{%- endfor %}
3634
{%- if error_case %}
37-
{%- if final == "pop" or final == "shift" %}
35+
{%- if error_operation == "pop" or error_operation == "shift" %}
3836
with self.assertRaises(IndexError) as err:
3937
lst.{{ error_operation }}()
4038
self.assertEqual(type(err.exception), IndexError)
41-
self.assertEqual(err.exception.args[0], "{{ error_msg }}")
42-
{% elif final == "delete" %}
39+
{%- elif error_operation == "delete" %}
4340
with self.assertRaises(ValueError) as err:
44-
lst.{{ final }}({{ value if value else 0 }})
41+
lst.{{ error_operation }}({{ value if value else 0 }})
4542
self.assertEqual(type(err.exception), ValueError)
46-
self.assertEqual(err.exception.args[0], "{{ error_msg }}")
4743
{%- endif %}
44+
self.assertEqual(err.exception.args[0], "{{ error_msg }}")
4845
{%- endif %}
4946
{%- endmacro %}
5047

0 commit comments

Comments
 (0)