| 405 | |
| 406 | |
| 407 | def test15_complex_undo(self): |
| 408 | # create a graph |
| 409 | self.graph.query("UNWIND range(1, 3) AS x CREATE (:N {v:x})-[:R{v:x}]->(:N {v:x})") |
| 410 | |
| 411 | try: |
| 412 | self.graph.query("MATCH (n:N)-[r:R]->(m:N) SET n.v = n.v + 1, r.v = r.v + 1, m.v = m.v + 1 CREATE (:N{v:n.v}) DELETE r RETURN CASE n.v WHEN 3 THEN n.v * 'a' ELSE n.v END") |
| 413 | # we're not supposed to be here, expecting query to fail |
| 414 | self.env.assertTrue(False) |
| 415 | except Exception as e: |
| 416 | self.env.assertEquals(str(e), "Type mismatch: expected Integer, Float, or Null but was String") |
| 417 | |
| 418 | # validate no changed is the created graph |
| 419 | expected_result = [[1, 1, 1], [2, 2, 2], [3, 3, 3]] |
| 420 | result = self.graph.query("MATCH (n:N)-[r:R]->(m:N) RETURN n.v, r.v, m.v") |
| 421 | self.env.assertEquals(result.result_set, expected_result) |
| 422 | |
| 423 | |
| 424 | def test16_undo_label_set(self): |