Skip to content

Commit

Permalink
[Mecha Munch Management] Add test case for send_to_store of extra ite…
Browse files Browse the repository at this point in the history
…m on isle_mapping (#3653)
  • Loading branch information
izmirli authored Mar 2, 2024
1 parent 55a0ab4 commit c224d7c
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions exercises/concept/mecha-munch-management/dict_methods_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def test_add_item(self):
f'expected: {expected} once the item was added.')

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


@pytest.mark.task(taskno=2)
def test_read_notes(self):
Expand Down Expand Up @@ -130,12 +129,20 @@ def test_send_to_store(self):
'Yoghurt': ['Aisle 2', True], 'Milk': ['Aisle 2', True]}),

({'Apple': 2, 'Raspberry': 2, 'Blueberries': 5,
'Broccoli' : 2, 'Kiwi': 1, 'Melon': 4},
'Broccoli': 2, 'Kiwi': 1, 'Melon': 4},

{'Apple': ['Aisle 1', False], 'Raspberry': ['Aisle 6', False],
'Blueberries': ['Aisle 6', False], 'Broccoli': ['Aisle 3', False],
'Kiwi': ['Aisle 6', False], 'Melon': ['Aisle 6', False]})
]
'Kiwi': ['Aisle 6', False], 'Melon': ['Aisle 6', False]}),

({'Orange': 1},
{'Banana': ['Aisle 5', False], 'Apple': ['Aisle 4', False],
'Orange': ['Aisle 4', False], 'Milk': ['Aisle 2', True]}),

({'Banana': 3, 'Apple': 2, 'Orange': 1},
{'Banana': ['Aisle 5', False], 'Apple': ['Aisle 4', False],
'Orange': ['Aisle 4', False], 'Milk': ['Aisle 2', True]}),
]

output_data = [
{'Orange': [1, 'Aisle 4', False], 'Milk': [2, 'Aisle 2', True],
Expand All @@ -146,8 +153,13 @@ def test_send_to_store(self):

{'Raspberry': [2, 'Aisle 6', False], 'Melon': [4, 'Aisle 6', False],
'Kiwi': [1, 'Aisle 6', False], 'Broccoli': [2, 'Aisle 3', False],
'Blueberries': [5, 'Aisle 6', False], 'Apple': [2, 'Aisle 1', False]}
]
'Blueberries': [5, 'Aisle 6', False], 'Apple': [2, 'Aisle 1', False]},

{'Orange': [1, 'Aisle 4', False]},

{'Orange': [1, 'Aisle 4', False], 'Banana': [3, 'Aisle 5', False],
'Apple': [2, 'Aisle 4', False]},
]

for variant, (input_data, expected) in enumerate(zip(input_data, output_data), start=1):
with self.subTest(f'variation #{variant}', input_data=input_data, expected=expected):
Expand Down

0 comments on commit c224d7c

Please sign in to comment.