def test_add_ingredient_to_inventory(self):
     obj_ingredient = Ingredient(IngredientsType.CoffeSyrup, 50)
     self.inventory.add_ingredient_to_inventory(obj_ingredient.ingredient_type.value, obj_ingredient.quantity)
     obj_ingredient = Ingredient(IngredientsType.HotWater, 100)
     self.inventory.add_ingredient_to_inventory(obj_ingredient.ingredient_type.value, obj_ingredient.quantity)
     obj_ingredient = Ingredient(IngredientsType.ElaichiSyrup, 20)
     self.inventory.add_ingredient_to_inventory(obj_ingredient.ingredient_type.value, obj_ingredient.quantity)
     obj_ingredient = Ingredient(IngredientsType.HotMilk, 80)
     self.inventory.add_ingredient_to_inventory(obj_ingredient.ingredient_type.value, obj_ingredient.quantity)
     obj_ingredient = Ingredient(IngredientsType.GingerSyrup, 20)
     self.inventory.add_ingredient_to_inventory(obj_ingredient.ingredient_type.value, obj_ingredient.quantity)
     self.assertEquals(len(self.inventory.inventory), 5)
Esempio n. 2
0
def ToAmerican(recipe):
    recipe = FromHealthy(recipe)
    recipe.pm = "artery-clog"
    americanAdd = [
        (Ingredient(1, "ounce", "freedom"), "with"),
        (Ingredient(100, "gallons", "liberty"), "with"),
        (Ingredient(1, 'pair of', 'guns'), "with"),
        (Ingredient(10, "kg", "butter"), "with"),
    ]
    for ingredient, timing in americanAdd:
        AddIngredient(recipe, ingredient, timing)
    return recipe
Esempio n. 3
0
def FromVegetarian(recipe):
    addedMeat = False
    for ingredient in recipe.ingredients:
        for veggieRepl in vegToMeat:
            if veggieRepl in ingredient.ingredient:
                ingrnew = Ingredient(ingredient.quantity,
                                     ingredient.measurement,
                                     vegToMeat[veggieRepl])
                TransformIngredient(recipe, ingredient, ingrnew)
                addedMeat = True
    if not addedMeat:
        meat = list(meatToVeg)[randint(0, len(meatToVeg))]
        AddIngredient(recipe, Ingredient(4, "ounces", meat), "with")

    return recipe
 def test_add_new_beverage(self):
     ingredients = list()
     ingredient = "hot_water"
     qty = 5
     obj_ingredient = Ingredient(ingredient, qty)
     ingredients.append(obj_ingredient)
     beverage = Beverage("black_coffee", ingredients)
     self.vending_machine.add_new_beverage(beverage)
Esempio n. 5
0
def FromHealthy(recipe):
    ingrnew = [
        Ingredient(1, "tablespoon", "salt"),
        Ingredient(1 / 4, "cup", "butter")
    ]
    for ingrx in ingrnew:
        AddIngredient(recipe, ingrx, "with")

    unhealthy = [
        "bacon", "tater tots", "vegetable oil", "marshmellow", "hot dog bits",
        "corn syrup", "margarine", "mayonnaise"
    ]
    i = 0
    for ingr in recipe.ingredients:
        if any(word in ingr.ingredient for word in [
                "carrot", "fruit", "bean", "apple", "lettuce", "spinach",
                "arugula", "tomato", "pea", "kale", "beet", "cucumber", "pear",
                "banana"
        ]):
            TransformIngredient(
                recipe, ingr,
                Ingredient(ingr.quantity, "ounce", unhealthy[randint(0, 7)]))

    if not any(word in recipe.title for word in ["salad", "sandwich"]):
        AddIngredient(recipe, Ingredient(1, 'cup', 'breading'), "none")
        phone = Phrase("bread")
        phone.typ = "Combine"
        phone.preps.append([FakePrep("in a large bowl", "NOUN", 415)])
        phone.tools.append("bowl")
        phone.ingrs.append("breading")
        AddAction(recipe, "end", phone)
        ph = Phrase("deep fry")
        ph.typ = "Cook"
        ph.objects.append("everything")
        AddAction(recipe, "end", ph)
        recipe.pm = "deep fry"

    AddIngredient(recipe, Ingredient(50, None, 'french fries'), "none")
    ph = Phrase("serve")
    ph.typ = "Wait"
    ph.preps.append([FakePrep("with side of french fries", "NOUN", 43500)])
    ph.ingrs.append("french fries")
    AddAction(recipe, "end", ph)

    return recipe
Esempio n. 6
0
def ToLethal(recipe):
    print(
        "\nSPONSORED: This transformation is brought to you by Clorox® Liquid Bleach."
    )
    ingrnew = Ingredient(2, "gallon", "bleach")
    AddIngredient(recipe, ingrnew, "end")
    recipe.pm = "poison"

    return recipe
Esempio n. 7
0
def ToVegetarian(recipe):
    for ingredient in recipe.ingredients:
        for meat in meatToVeg:
            if meat in ingredient.ingredient:
                ingrnew = Ingredient(ingredient.quantity,
                                     ingredient.measurement, meatToVeg[meat])
                TransformIngredient(recipe, ingredient, ingrnew)

    return recipe
Esempio n. 8
0
def ToSandwich(recipe):
    AddIngredient(recipe, Ingredient(2, "slices", "white bread"), "none")
    ph = Phrase("Place")
    ph.preps.append(
        [FakePrep("from this meal between white bread", "NOUN", 980)])
    ph.objects.append("leftovers")
    ph.ingrs.append("white bread")

    AddAction(recipe, "end", ph)
    recipe.pm = "sandwich"
    return recipe
Esempio n. 9
0
def ToHealthy(recipe):
    unhealthy = [
        "bacon", "tater tots", "marshmellow", "hot dog", "corn syrup",
        "margarine", "mayonnaise", "freedom", "guns", "butter", "liberty"
    ]

    ph = Phrase("trim")
    ph.type = "Prepare"
    for ingr in recipe.ingredients:
        if any(unhealth in ingr.ingredient for unhealth in unhealthy):
            recipe.ingredients.remove(ingr)
            continue
        if any(meat in ingr.ingredient for meat in meatToVeg):
            ph.objects.append(ingr.ingredient)
            ph.ingrs.append(ingr.ingredient)
        if any(sugaroil in ingr.ingredient for sugaroil in [
                "sugar", "syrup", "glaze", "honey", "oil", "spray", "lard",
                "butter", "fat", "grease"
        ]):
            ingr.quantity /= 3
        if "salt" in ingr.ingredient and "salted" not in ingr.ingredient:
            TransformIngredient(
                recipe, ingr,
                Ingredient(ingr.quantity, ingr.measurement, "onion powder"))

    if len(ph.objects) > 0:
        AddAction(recipe, "begin", ph)

    healthy = [
        "spinach", "onion", "zucchini", "kale", "oats", "quinoa",
        "green beans", "whole cucumber", "arugula head"
    ]
    AddIngredient(recipe,
                  Ingredient(0, "", healthy[randint(0, 8)] + " to taste"),
                  "before")

    return recipe
Esempio n. 10
0
def ToIndian(recipe):
    for ingredient in recipe.ingredients:
        for meatReplacement in toIndian:
            if meatReplacement in ingredient.ingredient:
                ingrnew = Ingredient(ingredient.quantity,
                                     ingredient.measurement,
                                     toIndian[meatReplacement])
                TransformIngredient(recipe, ingredient, ingrnew)
    AddIngredient(recipe, Ingredient(1 / 2, "tablespoon", "curry"), "with")
    AddIngredient(recipe, Ingredient(1, "teaspoon", "coriander"), "with")
    AddIngredient(recipe, Ingredient(1, "teaspoon", "cumin"), "with")
    AddIngredient(recipe, Ingredient(1, "teaspoon", "cayenne"), "with")
    AddIngredient(recipe, Ingredient(1, "teaspoon", "turmeric"), "with")
    recipe.pm = "curry"
    return recipe
Esempio n. 11
0
def ToThai(recipe):
    thaiAdd = [(Ingredient(1, "ounce", "peanut"), "with"),
               (Ingredient(1, "tablespoon", "chicken broth"), "with"),
               (Ingredient(2, "teaspoons", "soy sauce"), "with"),
               (Ingredient(1, "teaspoon", "fish sauce"), "with"),
               (Ingredient(1, "teaspoon", "white sugar"), "with"),
               (Ingredient(1, "tablespoon", "Serrano chili dust"), "with"),
               (Ingredient(.25, "cup",
                           "very thinly sliced fresh basil leaves"), "end"),
               (Ingredient(1, 'cup', 'rice noodles'), 'none')]
    for ingredient, timing in thaiAdd:
        AddIngredient(recipe, ingredient, timing)
    recipe.pm = "stir fry"
    phb = Phrase("boil")
    phb.typ = "Cook"
    phb.ingrs.append("rice noodles")
    phb.preps.extend([FakePrep("in saucepan over medium heat", "NOUN", 499)])
    phb.tools.append("saucepan")
    phb.objects.append("rice noodles")
    ph = Phrase("serve")
    ph.typ = "Wait"
    ph.ingrs.append("rice noodles")
    ph.preps.append(FakePrep("over noodles", "NOUN", 513))
    return recipe
Esempio n. 12
0
def main():
    # Prepare Inventory
    obj_inventory = Inventory.get_instance()
    all_item_with_qty = get_total_items_qty()
    for item,qty in all_item_with_qty.items():
        obj_inventory.add_ingredient_to_inventory(item, qty)
    all_beverages = get_all_beverages()
    beverages = list()
    outlets = get_total_outlets()
    vending_machine = VendingMachine.get_instance(outlets)
    for beverage,ingredient_with_qty in all_beverages.items():
        ingredients = list()
        for ingredient,qty in ingredient_with_qty.items():
            obj_ingredient = Ingredient(ingredient, qty)
            ingredients.append(obj_ingredient)
        beverage = Beverage(beverage, ingredients)
        vending_machine.add_new_beverage(beverage)
        beverages.append(beverage)
    for beverage in beverages:
        try:
            vending_machine.make_beverage(beverage)
        except Exception as e:
            print(e)
Esempio n. 13
0
def milk():
    return Ingredient(2, "Hot Milk", "ml")
Esempio n. 14
0
def sugar_syrup():
    return Ingredient(5, "Sugar syrup", "ml")
Esempio n. 15
0
def ginger_syrup():
    return Ingredient(4, "Ginger Syrup", "ml")
Esempio n. 16
0
 def add_item_ingredient(self):
     ingredient = Ingredient()
     ingredient.add_ingredient()
     self.ingredients.append(ingredient)
Esempio n. 17
0
def elaichi_syrup():
    return Ingredient(6, "Elaichi syrup", "ml")
Esempio n. 18
0
def water():
    return Ingredient(1, "Hot Water", "ml")
Esempio n. 19
0
 def add_item_ingredient(self):
     ingredient = Ingredient()
     ingredient.add_ingredient()
     self.ingredients.append(ingredient)
Esempio n. 20
0
def tea_leaves_syrup():
    return Ingredient(3, "Tea leaves syrup", "ml")