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

Method test29_merge_resue

tests/flow/test_graph_merge.py:591–615  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

589 self.env.assertEquals(result.nodes_created, 1)
590
591 def test29_merge_resue(self):
592 redis_con = self.env.getConnection()
593 graph = Graph(redis_con, "merge_reuse")
594 query = """
595 CREATE (m:L1 {v: "abc"})
596 CREATE (u:L2 {v: "x"})
597 CREATE (n:L2 {v: "y"})
598 CREATE (:L2 {v: 'y'})
599 CREATE (u)-[:R]->(m), (u)-[:R]->(m)
600 CREATE (n)-[:R]->(m), (n)-[:R]->(m)"""
601 graph.query(query)
602
603 query = """
604 MERGE (m:L1 {v: "abc"})
605 SET m.v = "abcd"
606 WITH m
607 MATCH (u:L2 {v: "x"})
608 MATCH (n:L2 {v: "y"})
609 MERGE (u)-[:R]->(m)<-[:R]-(n)
610 RETURN m.v, u.v, n.v"""
611
612 res = graph.query(query)
613 self.env.assertEquals(res.nodes_created, 0)
614 self.env.assertEquals(res.relationships_created, 0)
615 self.env.assertEquals(res.result_set, [['abcd', 'x', 'y']])
616
617 def test30_record_clone_under_merge(self):
618 # the following operations

Callers

nothing calls this directly

Calls 2

GraphClass · 0.85
queryMethod · 0.45

Tested by

no test coverage detected