Exemple #1
0
    def test_preparation_time_in_minutes(self):
        input_data = [1, 2, 5, 8, 11, 15]
        result_data = [item * 2 for item in input_data]

        for variant, (layers, time) in enumerate(zip(input_data, result_data), start=1):
            with self.subTest(f'variation #{variant}', layers=layers, time=time):
                failure_msg = f'Expected: {time} minutes, but preparation time was calculated incorrectly.'
                self.assertEqual(preparation_time_in_minutes(layers), time, msg=failure_msg)
Exemple #2
0
    def test_preparation_time_in_minutes(self):
        input_data = [1, 2, 5, 8, 11, 15]
        result_data = [item * 2 for item in input_data]

        for layers, time in zip(input_data, result_data):
            with self.subTest("preparation time calculation variants",
                              layers=layers,
                              time=time):
                self.assertEqual(preparation_time_in_minutes(layers), time)
Exemple #3
0
    def test_preparation_time_in_minutes(self):
        input_data = [1, 2, 5, 8, 11, 15]
        result_data = [item * 2 for item in input_data]
        number_of_variants = range(1, len(input_data) + 1)

        for variant, layers, time in zip(number_of_variants, input_data, result_data):
            with self.subTest(f"variation #{variant}", layers=layers, time=time):
                self.assertEqual(preparation_time_in_minutes(layers), time,
                                 msg=f'Expected: {time} minutes, but preparation time'
                                     f' was calculated incorrectly.')