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

Method test17_undo_remove_label

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

Source from the content-addressed store, hash-verified

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)
450 self.graph.query("CREATE (n:L2 {v:1})")
451 try:
452 self.graph.query("MATCH (n:L2) REMOVE n:L2 WITH n RETURN 1 * n")
453 # we're not supposed to be here, expecting query to fail
454 self.env.assertTrue(False)
455 except:
456 pass
457
458 # node label L2 not be removed
459 result = self.graph.query("MATCH (n:L2) RETURN labels(n)")
460 self.env.assertEquals(len(result.result_set), 1)
461 self.env.assertEquals(["L2"], result.result_set[0][0])
462 # check index is ok
463 query = "MATCH (n:L2 {v: 1}) RETURN n.v"
464 plan = self.graph.execution_plan(query)
465 self.env.assertContains("Node By Index Scan", plan)
466 result = self.graph.query(query)
467 self.env.assertEquals(result.result_set[0][0], 1)
468
469 def test18_undo_set_remove_label(self):
470 self.graph.query("CREATE (n:L3)")

Callers

nothing calls this directly

Calls 3

execution_planMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected