Ejemplo n.º 1
0
 def id(self):
     """
     Get internal id of Elements
     """
     current_pipe = pipes.ElementIdPipe()
     self.pipeline.add_pipe(current_pipe)
     return self
Ejemplo n.º 2
0
    def test_pipeline_graph_vertex_chain_to_list(self):
        pipeline_test = pipeline.Pipeline(
            self.graph_test_1.get_vertices_iterator(),
            [pipes.GraphVertexPipe(),
             pipes.ElementIdPipe()])

        self.assertEqual(pipeline_test.to_list(), [1, 2])
        self.assertEqual(
            str(pipeline_test),
            '[DictKeyValueIterator(2), GraphVertexPipe(), ElementIdPipe()]')
Ejemplo n.º 3
0
    def test_pipeline_graph_vertex_chain_to_list(self):
        graph = Graph()
        graph.add_vertex('test_label', {'test_field': 1})
        graph.add_vertex('test_label', {'test_field': 2})

        pipeline_test = pipeline.Pipeline(
            graph.get_vertices_iterator(),
            [pipes.GraphVertexPipe(),
             pipes.ElementIdPipe()])

        self.assertEqual(pipeline_test.to_list(), [1, 2])