def test_bake_time_remaining(self): input_data = [1, 2, 5, 10, 15, 23, 33, 39] result_data = [40 - item for item in input_data] for variant, (time, result) in enumerate(zip(input_data, result_data), start=1): with self.subTest(f'variation #{variant}', time=time, result=result): failure_msg = f'Expected: {result} but the bake time remaining was calculated incorrectly.' self.assertEqual(bake_time_remaining(time), result, msg=failure_msg)
def test_bake_time_remaining(self): input_data = [1, 2, 5, 10, 15, 23, 33, 39] result_data = [40 - item for item in input_data] number_of_variants = range(1, len(input_data) + 1) for variant, time, result in zip(number_of_variants, input_data, result_data): with self.subTest(f"variation #{variant}", time=time, result=result): self.assertEqual(bake_time_remaining(time), result, msg=f'Expected: {result} but the bake time remaining was calculated incorrectly.')
def bake_time_remaining(self): input_data = [1, 2, 5, 10, 15, 23, 33, 39] result_data = [40 - item for item in input_data] for time, result in zip(input_data, result_data): with self.subTest("bake time remaining variants", time=time, result=result): self.assertEqual(bake_time_remaining(time), result)