示例#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_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])
示例#3
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])
示例#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])
def main():
    Day0.run()
    Day1.run()
    Day2.run()
    Day3.run()
    Day4.run()
    Day5.run()
    Day6.run()
    Day7.run()
    Day8.run()
    Day9.run()
    Day10.run()
    Day11.run()
    Day12.run()
    Day13.run()
    Day14.run()
    Day15.run()
    Day16.run()
    Day17.run()
    Day18.run()
    Day19.run()
示例#6
0
 def test_puzzledata(self):
     self.assertEqual(Day9.solve("puzzledata.txt"), 428690)
示例#7
0
 def test_testdata1(self):
     self.assertEqual(Day9.solve("testdata1.txt"), 32)
示例#8
0
 def test_puzzledata2(self):
     self.assertEqual(Day9.solve("puzzledata2.txt"), 3628143500)