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

Method test_path_property_access

tests/flow/test_path.py:211–232  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

209
210 # Test property accesses against non-identifier entities.
211 def test_path_property_access(self):
212 node0 = Node(node_id=0, label="L1", properties={'value': 1})
213 node1 = Node(node_id=1, label="L1", properties={'value': 2})
214 edge01 = Edge(node0, "R1", node1, edge_id=0)
215
216 redis_graph.add_node(node0)
217 redis_graph.add_node(node1)
218 redis_graph.add_edge(edge01)
219
220 redis_graph.flush()
221
222 # Test access of pre-existing properties along a path.
223 query = """MATCH p=()-[]->() RETURN nodes(p)[0].value, nodes(p)[1].value"""
224 result = redis_graph.query(query)
225 expected_result = [[1, 2]]
226 self.env.assertEqual(result.result_set, expected_result)
227
228 # Test access of properties introduced by the query.
229 query = """MATCH p=(a)-[]->() SET a.newval = 'new' RETURN nodes(p)[0].value, nodes(p)[0].newval"""
230 result = redis_graph.query(query)
231 expected_result = [[1, 'new']]
232 self.env.assertEqual(result.result_set, expected_result)
233
234 # Test path deletion
235 def test_path_deletion(self):

Callers

nothing calls this directly

Calls 3

NodeClass · 0.50
EdgeClass · 0.50
queryMethod · 0.45

Tested by

no test coverage detected