Ejemplo n.º 1
0
 def carbohydrates(self) -> float:
     carbohydrates = calculate_recipe_nutri(
         self.recipe.total_carbohydrates, self.piece
     )
     return carbohydrates
Ejemplo n.º 2
0
 def proteins(self) -> float:
     proteins = calculate_recipe_nutri(self.recipe.total_proteins, self.piece)
     return proteins
Ejemplo n.º 3
0
 def fats(self) -> float:
     fats = calculate_recipe_nutri(self.recipe.total_fats, self.piece)
     return fats
Ejemplo n.º 4
0
def test_calc_recipe_nutri():
    calories = Decimal(100.25)
    piece = Decimal(1.5)
    assert calculate_recipe_nutri(calories, piece) == 150.38