(self)
| 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) |
nothing calls this directly
no test coverage detected