コード例 #1
0
ファイル: batch_test.py プロジェクト: zrg1993/py2neo
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
コード例 #2
0
ファイル: batch_test.py プロジェクト: JohannesOos/py2neo
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
コード例 #3
0
ファイル: batch_test.py プロジェクト: zrg1993/py2neo
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
コード例 #4
0
ファイル: batch_test.py プロジェクト: JohannesOos/py2neo
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