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

Method test05_create_edge_effect

tests/flow/test_effects.py:270–306  ·  view source on GitHub ↗
(self, expect_effect=True)

Source from the content-addressed store, hash-verified

268 self.assert_graph_eq()
269
270 def test05_create_edge_effect(self, expect_effect=True):
271 # tests the introduction of a new edge by an effect
272
273 # no leftovers from previous test
274 self.env.assertFalse(self.monitor_containt_effect())
275
276 # edge without attributes
277 q1 = """CREATE ()-[:R]->()"""
278
279 # edge with attributes
280 q2 = """CREATE ()-[:CONNECT {
281 ei:1,
282 s:'str',
283 eb:True,
284 a:[1, [2], '3'],
285 ep:point({latitude: 51, longitude: 0}),
286 f:3.14,
287 empty_string: ''}
288 ]->()"""
289
290 # edge between an existing node and a new node
291 q3 = """MATCH (a) WITH a LIMIT 1 CREATE (a)-[:R]->()"""
292
293 # edge between two existing nodes
294 q4 = """MATCH (a), (b) WITH a, b LIMIT 1 CREATE (a)-[:R]->(b)"""
295
296 queries = [q1, q2, q3, q4]
297 for q in queries:
298 res = self.query_master_and_wait(q)
299 self.env.assertEquals(res.relationships_created, 1)
300
301 if(expect_effect):
302 self.wait_for_effect()
303 else:
304 self.wait_for_query()
305
306 self.assert_graph_eq()
307
308 def test06_update_node_effect(self, expect_effect=True):
309 # test an entity attribute set update by an effect

Callers 1

Calls 5

query_master_and_waitMethod · 0.95
wait_for_effectMethod · 0.95
wait_for_queryMethod · 0.95
assert_graph_eqMethod · 0.95

Tested by

no test coverage detected