Beispiel #1
0
    def test_elapsed_time_in_minutes(self):
        layer_data = (1, 2, 5, 8, 11, 15)
        time_data = (3, 7, 8, 4, 15, 20)
        result_data = [prep * 2 + elapsed for prep, elapsed in zip(layer_data, time_data)]

        for variant, (layers, time, total_time) in enumerate(zip(layer_data, time_data, result_data), start=1):
            with self.subTest(f'variation #{variant}', layers=layers, time=time, total_time=total_time):
                failure_msg = f'Expected {time} minutes elapsed, but the timing was calculated incorrectly.'
                self.assertEqual(elapsed_time_in_minutes(layers, time), total_time, msg=failure_msg)
Beispiel #2
0
    def test_elapsed_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("bake time remaining variants",
                              layers=layers,
                              time=time):
                self.assertEqual(elapsed_time_in_minutes(8, 10), 26)
Beispiel #3
0
    def test_elapsed_time_in_minutes(self):
        layer_data = (1, 2, 5, 8, 11, 15)
        time_data = (3, 7, 8, 4, 15, 20)
        result_data = [prep * 2 + elapsed for prep, elapsed in zip(layer_data, time_data)]
        number_of_variants = range(1, len(time_data) + 1)

        for variant, layers, time, total_time in zip(number_of_variants, layer_data, time_data, result_data):
            with self.subTest(f"variation #{variant}", layers=layers, time=time, total_time=total_time):

                failure_msg = f'Expected {time} minutes elapsed, but the timing was calculated incorrectly.'
                self.assertEqual(elapsed_time_in_minutes(layers, time), total_time,msg=failure_msg)