def setUp(self):
     grid_1_path = './test/fixtures/grid-1.txt'
     grid_2_path = './test/fixtures/grid-2.txt'
     grid_3_path = './test/fixtures/grid-3.txt'
     grid_4_path = './test/fixtures/grid-4.txt'
     grid_5_path = './test/fixtures/grid-5.txt'
     self.graph_1s = [
         graph.AdjacencyList(),
         graph.AdjacencyMatrix(),
         graph.ObjectOriented()
     ]
     self.graph_2s = [
         graph.AdjacencyList(),
         graph.AdjacencyMatrix(),
         graph.ObjectOriented()
     ]
     self.graph_3s = [
         graph.AdjacencyList(),
         graph.AdjacencyMatrix(),
         graph.ObjectOriented()
     ]
     self.graph_1s = list(
         map(construct_grid_graph(grid_1_path), self.graph_1s))
     self.graph_2s = list(
         map(construct_grid_graph(grid_2_path), self.graph_2s))
     self.graph_3s = list(
         map(construct_grid_graph(grid_3_path), self.graph_3s))
     self.graph_4 = utils.parse_grid_file(graph.AdjacencyList(),
                                          grid_4_path)
     self.graph_4 = utils.parse_grid_file(graph.AdjacencyList(),
                                          grid_5_path)
Esempio n. 2
0
def construct_grid_graph(file_path):
    """Helper function to construct graph given graph_path"""
    return lambda g: utils.parse_grid_file(g, file_path)