def test_cypher_job_with_bad_syntax(graph): batch = WriteBatch(graph) batch.append(CypherJob("X")) try: batch.submit() except BatchError as error: assert error.batch is batch assert error.job_id == 0 assert error.status_code == 400 assert error.uri == "cypher" else: assert False
def test_cypher_job_with_non_existent_node_id(graph): node = Node() graph.create(node) node_id = node._id graph.delete(node) batch = WriteBatch(graph) batch.append(CypherJob("START n=node({N}) RETURN n", {"N": node_id})) try: batch.submit() except BatchError as error: assert error.batch is batch assert error.job_id == 0 assert error.status_code == 400 assert error.uri == "cypher" else: assert False