def test_get_current_time(self): solution = Solution(temp_test_case, 1, 100) solution.answer = list(temp_test_case) solution.alphas = [1, 1, 1] ans = Solution.get_current_time(solution, 'Kraków', solution.all_available_time) [current_time, currently_available_time] = ans self.assertEqual(0, current_time) self.assertEqual(73, currently_available_time ) # 100-[Warszawa(15)+trasa(2)+Lublin(10)] = 73 # --------------------------------------------------- solution = Solution(temp_test_case_2, 1, 100) solution.answer = list(temp_test_case) solution.alphas = [1, 1, 1] ans = Solution.get_current_time(solution, 'Warszawa', solution.all_available_time) [current_time, currently_available_time] = ans self.assertEqual(0, current_time) self.assertEqual(50, currently_available_time ) # 100-[Kraków(30)+trasa(2)+Lublin(20)] = 50
def test_count_satisfaction_points(self): solution = Solution(temp_test_case, 10, 100) solution.answer = list(temp_test_case) solution.alphas = [1, 1, 1] Solution.count_satisfaction_points(solution) self.assertEqual(10, solution.satisfaction_points)