MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / populate_graph

Method populate_graph

tests/flow/test_with_clause.py:17–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15 self.populate_graph()
16
17 def populate_graph(self):
18 # Populate a graph with two labels, each containing the same property values but different keys.
19 # Each node pair is connected by an edge from label_a to label_b
20 for idx, v in enumerate(values):
21 src = Node(label="label_a", properties={"a_val": v, "a_idx": idx})
22 dest = Node(label="label_b", properties={"b_val": v, "b_idx": idx})
23 redis_graph.add_node(src)
24 redis_graph.add_node(dest)
25 edge = Edge(src, 'connects', dest, properties={"edgeval": idx})
26 redis_graph.add_edge(edge)
27 redis_graph.commit()
28
29 # Verify that graph entities specified in a WITH clause are returned properly
30 def test01_with_scalar_read_queries(self):

Callers 1

__init__Method · 0.95

Calls 2

NodeClass · 0.50
EdgeClass · 0.50

Tested by

no test coverage detected