def test_compile_ingredients(self): test_data = zip(ingredients_only, [VEGAN, VEGETARIAN, PALEO, KETO, OMNIVORE]) for variant, (item, result) in enumerate(test_data, start=1): with self.subTest(f"variation #{variant}", item=item, result=result): error_message = "Expected a proper set of combined ingredients, but something went wrong." self.assertEqual(compile_ingredients(item), (result), msg=error_message)
def test_compile_ingredients(self): input_data = ingredients_only result_data = [VEGAN, VEGETARIAN, PALEO, KETO, OMNIVORE] number_of_variants = number_of_variants = range(1, len(input_data) + 1) for variant, item, result in zip(number_of_variants, input_data, result_data): with self.subTest(f"variation #{variant}", item=item, result=result): self.assertEqual(compile_ingredients(item), (result))