Пример #1
0
 def test_remove_ingredients_with_quantity_higher_than_what_we_have_should_return_message(
         self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     message = t.remove_ingredient('tomatoes', 2, 2)
     self.assertEqual(t.ingredients, {'cheese': 2, 'tomatoes': 1})
     self.assertEqual(
         message, 'Please check again the desired quantity of tomatoes!')
Пример #2
0
 def test_remove_ingredients_not_included_in_pizza_should_return_message(
         self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     message = t.remove_ingredient('bacon', 1, 5)
     self.assertEqual(t.ingredients, {'cheese': 2, 'tomatoes': 1})
     self.assertEqual(
         message,
         'Wrong ingredient selected! We do not use bacon in Margarita!')
Пример #3
0
 def test_remove_ingredient_after_pizza_is_ordered_should_return_message(
         self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     order = t.make_order()
     result = t.remove_ingredient('mozzarella', 1, 2)
     self.assertEqual(
         order,
         "You've ordered pizza Margarita prepared with cheese: 2, tomatoes: 1 and the price will be 12lv."
     )
     self.assertEqual(
         result,
         "Pizza Margarita already prepared and we can't make any changes!")
Пример #4
0
 def test_remove_ingredients_with_quantity_equal_to_what_we_have_should_remove_the_ingredient(
         self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     t.remove_ingredient('tomatoes', 1, 2)
     self.assertEqual(t.ingredients, {'cheese': 2, 'tomatoes': 0})
     self.assertEqual(t.price, 10)