Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions exercises/concept/inventory-management/dicts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ def test_not_below_zero(self):

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

@pytest.mark.task(taskno=3)
def test_decrement_items_not_in_inventory(self):
actual_result = decrement_items({"iron": 3, "gold": 2},
["iron", "wood", "iron", "diamond"])

expected = {"iron": 1, "gold": 2}
error_message = ('Called decrement_items({"iron": 3, "gold": 2}, '
'["iron", "wood", "iron", "diamond"]). The function '
f'returned {actual_result}, but the tests '
f'expected {expected}.')

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

@pytest.mark.task(taskno=4)
def test_remove_item(self):
actual_result = remove_item({"iron": 1, "diamond": 2, "gold": 1}, "diamond")
Expand Down