Esempio n. 1
0
 def test_shortest_path__lines_c(self):
     "More complex shortest path c"
     point_a = self.reader.get_node(4)
     point_b = self.reader.get_node(9)
     path = shortest_path(point_a, point_b)
     path = [line.line_id for line in path]
     self.assertSequenceEqual(path, [8, 9, 10])
Esempio n. 2
0
 def test_shortest_path__lines_b(self):
     "Shortest path where the path is two lines (b)"
     point_a = self.reader.get_node(0)
     point_b = self.reader.get_node(3)
     path = shortest_path(point_a, point_b)
     path = [line.line_id for line in path]
     self.assertSequenceEqual(path, [1, 3])
Esempio n. 3
0
 def test_shortest_path__lines_a(self):
     "More complex shortest path a"
     point_a = self.reader.get_node(1)
     point_b = self.reader.get_node(11)
     path = shortest_path(point_a, point_b)
     path = [line.line_id for line in path]
     self.assertSequenceEqual(path, [2, 5, 8, 14])
Esempio n. 4
0
 def test_shortest_path_oneline(self):
     "Shortest path where the path is one line"
     point_a = self.reader.get_node(0)
     point_b = self.reader.get_node(2)
     path = shortest_path(point_a, point_b)
     self.assertIsNotNone(path)
     path = [line.line_id for line in path]
     self.assertSequenceEqual(path, [1])
Esempio n. 5
0
 def test_shortest_path_same_node(self):
     "Shortest path between a node and itself is empty"
     point_a = self.reader.get_node(0)
     path = shortest_path(point_a, point_a)
     self.assertIsNotNone(path)
     self.assertSequenceEqual(path, [])