def test_macronutrient_percent_raises_value_error(self, fat_percent, carb_percent, protein_percent): with pytest.raises(ValueError, message="Expected ValueError"): meal_maker.MakeMeal(150, body_type=None, fat_percent=fat_percent, carb_percent=carb_percent, protein_percent=protein_percent)
def test_make_meal(self, weight, meals, body_type, activity_level, goal, min_cal, max_cal, fat_percent, carb_percent, protein_percent, expected): assert meal_maker.MakeMeal( weight, body_type=body_type, activity_level=activity_level, goal=goal, min_cal=min_cal, max_cal=max_cal, fat_percent=fat_percent, carb_percent=carb_percent, protein_percent=protein_percent).make_meal(meals) == expected
def test_daily_requirements(self, weight, body_type, activity_level, goal, min_cal, max_cal, fat_percent, carb_percent, protein_percent, expected): assert meal_maker.MakeMeal( weight, body_type=body_type, activity_level=activity_level, goal=goal, min_cal=min_cal, max_cal=max_cal, fat_percent=fat_percent, carb_percent=carb_percent, protein_percent=protein_percent).daily_requirements() == expected
def test_check_min_cal_raises_type_error(self, type_error_cal): with pytest.raises(TypeError, message="Expected TypeError"): meal_maker.MakeMeal(150, body_type='mesomorph', min_cal=type_error_cal)
def test_check_max_cal_raises_value_error(self, value_error_cal): with pytest.raises(ValueError, message="Expected ValueError"): meal_maker.MakeMeal(150, body_type='mesomorph', max_cal=value_error_cal)
def test_set_optimum_calories_raises_value_error(self, activity_level, goal): with pytest.raises(ValueError, message="Expected ValueError"): meal_maker.MakeMeal(150, activity_level=activity_level, goal=goal)
def test_check_weight_value_error(self, value_error_check_weight): with pytest.raises(ValueError, message="Expected Value Error"): meal_maker.MakeMeal(value_error_check_weight)
def test_check_weight_type_error(self, type_error_check_weight): with pytest.raises(TypeError, message="Expected TypeError"): meal_maker.MakeMeal(type_error_check_weight)
def test_expected_max_cal(self, body_type, activity_level, goal, expected_max_cal): assert meal_maker.MakeMeal(150, body_type=body_type, activity_level=activity_level, goal=goal).max_cal == expected_max_cal
def test_carb_percent(self, body_type, expected): assert meal_maker.MakeMeal( 150, body_type=body_type).carb_percent == expected
def test_body_type_raises_value_error(self, value_error_body_type): with pytest.raises(ValueError, message="Expected ValueError"): meal_maker.MakeMeal(150, body_type=value_error_body_type)