def test_get_edge_from_subedge(self): """ test that tests getting a edge from a graph mapper based off its subedge :return: """ subvertices = list() subvertices.append(PartitionedVertex(None, "")) subvertices.append(PartitionedVertex(None, "")) subedges = list() subedges.append(MultiCastPartitionedEdge(subvertices[0], subvertices[1])) subedges.append(MultiCastPartitionedEdge(subvertices[1], subvertices[1])) sube = MultiCastPartitionedEdge(subvertices[1], subvertices[0]) subedges.append(sube) # Create the graph mapper graph = GraphMapper() edge = TestPartitionableEdge(TestVertex(10, "pre"), TestVertex(5, "post")) graph.add_partitioned_edge(sube, edge) graph.add_partitioned_edge(subedges[0], edge) edge_from_subedge = \ graph.get_partitionable_edge_from_partitioned_edge(sube) self.assertEqual(edge_from_subedge, edge) self.assertEqual( graph.get_partitionable_edge_from_partitioned_edge(subedges[0]), edge ) self.assertRaises( PacmanNotFoundError, graph.get_partitionable_edge_from_partitioned_edge, subedges[1] )