Ejemplo n.º 1
0
 def test_shortest1(self):
     self.path1 = find_shortest_path("graph.txt", 1, 8)
     self.answer1 = (8.0, [1.0, 3.0, 5.0, 7.0, 8.0])
     assert self.path1 == self.answer1
Ejemplo n.º 2
0
 def test_shortest2(self):
     self.path2 = find_shortest_path("graph.txt", 1, 1)
     self.answer2 = (0, [1.0])
     assert self.path2 == self.answer2
Ejemplo n.º 3
0
 def test_shortest3(self):
     self.path3 = find_shortest_path("graph.txt", 2, 7)
     self.answer3 = None
     assert self.path3 == self.answer3
Ejemplo n.º 4
0
 def test_shortest_1(self):
     self.answer = (3.0, [1, 5, 8])
     self.input = find_shortest_path("shortest_graph.txt", 1, 8)
     assert self.input == self.answer
Ejemplo n.º 5
0
 def test_shortest_5(self):
     self.answer = (3, [1, 2, 4])
     self.input = find_shortest_path("shortest_graph2.txt", 1, 4)
     assert self.input == self.answer
Ejemplo n.º 6
0
 def test_shortest_4(self):
     self.answer = (5, [1, 2, 3, 4, 6])
     self.input = find_shortest_path("shortest_graph1.txt", 1, 6)
     assert self.input == self.answer
Ejemplo n.º 7
0
 def test_shortest_3(self):
     self.answer = (5, [8, 5, 3, 9])
     self.input = find_shortest_path("shortest_graph.txt", 8, 9)
     assert self.input == self.answer
Ejemplo n.º 8
0
 def test_shortest_2(self):
     self.answer = (None, None)
     self.input = find_shortest_path("shortest_graph.txt", 1, 4)
     assert self.input == self.answer