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