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

Method test16_undo_label_set

tests/flow/test_undo_log.py:424–446  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

422
423
424 def test16_undo_label_set(self):
425 create_node_exact_match_index(self.graph, "L1", "v", sync=True)
426 self.graph.query("CREATE (n:L1 {v:1})")
427 try:
428 self.graph.query("MATCH (n:L1) SET n:L2 WITH n RETURN 1 * n")
429 # we're not supposed to be here, expecting query to fail
430 self.env.assertTrue(False)
431 except:
432 pass
433
434 # node label L2 should not be added, expecting an empty result set
435 result = self.graph.query("MATCH (n:L2) RETURN n")
436 self.env.assertEquals(len(result.result_set), 0)
437 # check index is ok
438 query = "MATCH (n:L1 {v: 1}) RETURN n.v"
439 plan = self.graph.execution_plan(query)
440 self.env.assertContains("Node By Index Scan", plan)
441 result = self.graph.query(query)
442 self.env.assertEquals(result.result_set[0][0], 1)
443
444 # L2 label should not be created
445 result = self.graph.query("CALL db.labels")
446 self.env.assertEquals(result.result_set, [["L1"]])
447
448 def test17_undo_remove_label(self):
449 create_node_exact_match_index(self.graph, "L2", "v", sync=True)

Callers

nothing calls this directly

Calls 3

execution_planMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected