Пример #1
0
 def test_case_1(self):
     test_graph = {}
     Day9.add_connection_to_graph(test_graph, "London", "Dublin", 464)
     Day9.add_connection_to_graph(test_graph, "London", "Belfast", 518)
     Day9.add_connection_to_graph(test_graph, "Dublin", "Belfast", 141)
     actual = Day9.route(test_graph)
     self.assertEqual(605, actual[1])
Пример #2
0
 def test_case_1(self):
     test_graph = {}
     Day9.add_connection_to_graph(test_graph, 'London', 'Dublin', 464)
     Day9.add_connection_to_graph(test_graph, 'London', 'Belfast', 518)
     Day9.add_connection_to_graph(test_graph, 'Dublin', 'Belfast', 141)
     actual = Day9.route(test_graph)
     self.assertEqual(605, actual[1])
Пример #3
0
 def test_case_2(self):
     test_graph = {}
     Day9.add_connection_to_graph(test_graph, "London", "Dublin", 464)
     Day9.add_connection_to_graph(test_graph, "London", "Belfast", 518)
     Day9.add_connection_to_graph(test_graph, "Dublin", "Belfast", 141)
     actual = Day9.route(test_graph, longest_path=True)
     self.assertEqual(982, actual[1])
Пример #4
0
 def test_case_2(self):
     test_graph = {}
     Day9.add_connection_to_graph(test_graph, 'London', 'Dublin', 464)
     Day9.add_connection_to_graph(test_graph, 'London', 'Belfast', 518)
     Day9.add_connection_to_graph(test_graph, 'Dublin', 'Belfast', 141)
     actual = Day9.route(test_graph, longest_path=True)
     self.assertEqual(982, actual[1])