Skip to content

Commit 9d7aba4

Browse files
authored
[Inventory Management] New test for decrement_items not in inventory (exercism#3618)
[no important files changed]
1 parent 98e9bfe commit 9d7aba4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

exercises/concept/inventory-management/dicts_test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ def test_not_below_zero(self):
7777

7878
self.assertEqual(actual_result, expected, msg=error_message)
7979

80+
@pytest.mark.task(taskno=3)
81+
def test_decrement_items_not_in_inventory(self):
82+
actual_result = decrement_items({"iron": 3, "gold": 2},
83+
["iron", "wood", "iron", "diamond"])
84+
85+
expected = {"iron": 1, "gold": 2}
86+
error_message = ('Called decrement_items({"iron": 3, "gold": 2}, '
87+
'["iron", "wood", "iron", "diamond"]). The function '
88+
f'returned {actual_result}, but the tests '
89+
f'expected {expected}.')
90+
91+
self.assertEqual(actual_result, expected, msg=error_message)
92+
8093
@pytest.mark.task(taskno=4)
8194
def test_remove_item(self):
8295
actual_result = remove_item({"iron": 1, "diamond": 2, "gold": 1}, "diamond")

0 commit comments

Comments
 (0)