1viktors_ingredients = ['чушки', 'домати', 'моркови', 'ябълки', 'сол', 'черен пипер', 'кимион', 'зехтин']
2
3georgis_ingredients = ('чушки', 'домати', 'патладжан', 'люти чушки', 'олио', 'захар', 'чубрица', 'черен пипер', 'врачанска ракия')
4
5shopping_list = []
6shopping_list.extend(viktors_ingredients)
7shopping_list.extend(georgis_ingredients)
8
9shopping_list = shopping_list[::-1]
10
11unique_ingredients = set(shopping_list)
12
13ingredient_quantities = dict.fromkeys(unique_ingredients, 5)
14number_of_ingredients_to_buy = len(ingredient_quantities)
..FF....
======================================================================
FAIL: test_ingredient_quantities (test.TestLyutenitsa.test_ingredient_quantities)
All ingredients should have a quantity of 5, except for skyr (1).
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 51, in test_ingredient_quantities
self.assertEqual(ingredient_quantities,
AssertionError: {'ябълки': 5, 'чубрица': 5, 'моркови': 5, '[150 chars]': 5} != {'врачанска ракия': 5, 'черен пипер': 5, 'ч[161 chars]': 1}
+ {'skyr': 1,
- {'врачанска ракия': 5,
? ^
+ 'врачанска ракия': 5,
? ^
'домати': 5,
'захар': 5,
'зехтин': 5,
'кимион': 5,
'люти чушки': 5,
'моркови': 5,
'олио': 5,
'патладжан': 5,
'сол': 5,
'черен пипер': 5,
'чубрица': 5,
'чушки': 5,
'ябълки': 5}
======================================================================
FAIL: test_number_of_ingredients_to_buy (test.TestLyutenitsa.test_number_of_ingredients_to_buy)
The number of ingredients to buy should be 14.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 59, in test_number_of_ingredients_to_buy
self.assertEqual(number_of_ingredients_to_buy, 15)
AssertionError: 14 != 15
----------------------------------------------------------------------
Ran 8 tests in 0.001s
FAILED (failures=2)
f | 1 | viktors_ingredients = ['чушки', 'домати', 'моркови', 'ябълки', 'сол', 'черен пипер', 'кимион', 'зехтин'] | f | 1 | viktors_ingredients = ['чушки', 'домати', 'моркови', 'ябълки', 'сол', 'черен пипер', 'кимион', 'зехтин'] |
2 | 2 | ||||
3 | georgis_ingredients = ('чушки', 'домати', 'патладжан', 'люти чушки', 'олио', 'захар', 'чубрица', 'черен пипер', 'врачанска ракия') | 3 | georgis_ingredients = ('чушки', 'домати', 'патладжан', 'люти чушки', 'олио', 'захар', 'чубрица', 'черен пипер', 'врачанска ракия') | ||
4 | 4 | ||||
5 | shopping_list = [] | 5 | shopping_list = [] | ||
6 | shopping_list.extend(viktors_ingredients) | 6 | shopping_list.extend(viktors_ingredients) | ||
7 | shopping_list.extend(georgis_ingredients) | 7 | shopping_list.extend(georgis_ingredients) | ||
8 | 8 | ||||
n | 9 | shopping_list[::-1] | n | 9 | shopping_list = shopping_list[::-1] |
10 | 10 | ||||
11 | unique_ingredients = set(shopping_list) | 11 | unique_ingredients = set(shopping_list) | ||
12 | 12 | ||||
13 | ingredient_quantities = dict.fromkeys(unique_ingredients, 5) | 13 | ingredient_quantities = dict.fromkeys(unique_ingredients, 5) | ||
14 | number_of_ingredients_to_buy = len(ingredient_quantities) | 14 | number_of_ingredients_to_buy = len(ingredient_quantities) | ||
t | 15 | t |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
f | 1 | viktors_ingredients = ['чушки', 'домати', 'моркови', 'ябълки', 'сол', 'черен пипер', 'кимион', 'зехтин'] | f | 1 | viktors_ingredients = ['чушки', 'домати', 'моркови', 'ябълки', 'сол', 'черен пипер', 'кимион', 'зехтин'] |
2 | 2 | ||||
3 | georgis_ingredients = ('чушки', 'домати', 'патладжан', 'люти чушки', 'олио', 'захар', 'чубрица', 'черен пипер', 'врачанска ракия') | 3 | georgis_ingredients = ('чушки', 'домати', 'патладжан', 'люти чушки', 'олио', 'захар', 'чубрица', 'черен пипер', 'врачанска ракия') | ||
4 | 4 | ||||
5 | shopping_list = [] | 5 | shopping_list = [] | ||
6 | shopping_list.extend(viktors_ingredients) | 6 | shopping_list.extend(viktors_ingredients) | ||
7 | shopping_list.extend(georgis_ingredients) | 7 | shopping_list.extend(georgis_ingredients) | ||
8 | 8 | ||||
9 | shopping_list[::-1] | 9 | shopping_list[::-1] | ||
10 | 10 | ||||
11 | unique_ingredients = set(shopping_list) | 11 | unique_ingredients = set(shopping_list) | ||
12 | 12 | ||||
13 | ingredient_quantities = dict.fromkeys(unique_ingredients, 5) | 13 | ingredient_quantities = dict.fromkeys(unique_ingredients, 5) | ||
14 | number_of_ingredients_to_buy = len(ingredient_quantities) | 14 | number_of_ingredients_to_buy = len(ingredient_quantities) | ||
15 | 15 | ||||
t | 16 | print(shopping_list) | t | ||
17 | print(shopping_list[::-1]) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|