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

Method test06_update_node_effect

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

Source from the content-addressed store, hash-verified

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
310
311 # no leftovers from previous test
312 self.env.assertFalse(self.monitor_containt_effect())
313
314 q = """MATCH (n:L)
315 WITH n
316 LIMIT 1
317 SET
318 n.xa = 2,
319 n.b = 'string',
320 n.xc = False,
321 n.d = [[2], 1, '3'],
322 n.xe = point({latitude: 41, longitude: 2}),
323 n.f=6.28,
324 n.xempty_string = ''"""
325
326 res = self.query_master_and_wait(q)
327 self.env.assertGreater(res.properties_set, 0)
328
329 if(expect_effect):
330 self.wait_for_effect()
331 else:
332 self.wait_for_query()
333
334 self.assert_graph_eq()
335
336 # update the same attribute multiple times
337 q = """MATCH (n:L)
338 WITH n
339 LIMIT 1
340 UNWIND range(0, 10) AS i
341 SET
342 n.xa = n.xa + 1"""
343
344 res = self.query_master_and_wait(q)
345 self.env.assertEquals(res.properties_set, 11)
346
347 if(expect_effect):
348 self.wait_for_effect()
349 else:
350 self.wait_for_query()
351
352 self.assert_graph_eq()
353
354 # update using map overwrite
355 q = """MATCH (n:L)
356 WITH n
357 LIMIT 1
358 SET n = {
359 a:3,
360 b:'_string_',
361 c:True,
362 d:[['3'], 2, 1],
363 e:point({latitude: 2, longitude: 41}),
364 f:2.68,
365 empty_string:''}"""

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