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

Method test07_update_edge_effect

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

Source from the content-addressed store, hash-verified

464 self.assert_graph_eq()
465
466 def test07_update_edge_effect(self, expect_effect=True):
467
468 # no leftovers from previous test
469 self.env.assertFalse(self.monitor_containt_effect())
470
471 # test an edge attribute set update by an effect
472 q = """MATCH ()-[e]->()
473 WITH e
474 LIMIT 1
475 SET
476 e.a = 2,
477 e.b = 'string',
478 e.c = False,
479 e.d = [[2], 1, '3'],
480 e.e = point({latitude: 41, longitude: 2}),
481 e.f=6.28,
482 e.empty_string = ''"""
483
484 res = self.query_master_and_wait(q)
485 self.env.assertGreater(res.properties_set, 0)
486
487 if(expect_effect):
488 self.wait_for_effect()
489 else:
490 self.wait_for_query()
491
492 self.assert_graph_eq()
493
494 # update the same attribute multiple times
495 q = """MATCH ()-[e]->()
496 WITH e
497 LIMIT 1
498 UNWIND range(0, 10) AS i
499 SET
500 e.a = e.a + 1"""
501
502 res = self.query_master_and_wait(q)
503 self.env.assertEquals(res.properties_set, 11)
504
505 if(expect_effect):
506 self.wait_for_effect()
507 else:
508 self.wait_for_query()
509
510 self.assert_graph_eq()
511
512 # update using map overwrite
513 q = """MATCH ()-[e]->()
514 WITH e
515 LIMIT 1
516 SET e = {
517 a:3,
518 b:'_string_',
519 c:True,
520 d:[['3'], 2, 1],
521 e:point({latitude: 2, longitude: 41}),
522 f:2.68,
523 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