def test_get_vertex_from_subvertex(self): """ test that the graph mapper can retribve a vertex froma given subvertex :return: """ subvertices = list() subvertices.append(PartitionedVertex(None, "")) subvertices.append(PartitionedVertex(None, "")) subvert1 = PartitionedVertex(None, "") subvert2 = PartitionedVertex(None, "") graph_mapper = GraphMapper() vert = TestVertex(10, "Some testing vertex") vertex_slice = Slice(0, 1) graph_mapper.add_subvertex(subvert1, vertex_slice, vert) vertex_slice = Slice(2, 3) graph_mapper.add_subvertex(subvert2, vertex_slice, vert) self.assertEqual( vert, graph_mapper.get_vertex_from_subvertex(subvert1)) self.assertEqual( vert, graph_mapper.get_vertex_from_subvertex(subvert2)) self.assertEqual( None, graph_mapper.get_vertex_from_subvertex(subvertices[0])) self.assertEqual( None, graph_mapper.get_vertex_from_subvertex(subvertices[1]))