Exemplo n.º 1
0
def test_auto_run_with_pull_all(service_profile):
    connector = Connector(service_profile)
    result = connector.auto_run("UNWIND range(1, 5) AS n RETURN n")
    connector.pull(result, -1)
    assert result.take() == [1]
    assert result.take() == [2]
    assert result.take() == [3]
    assert result.take() == [4]
    assert result.take() == [5]
    assert result.take() is None
    connector.close()
Exemplo n.º 2
0
def test_auto_run_with_pull_3_then_pull_all(service_profile):
    cx = Connector(service_profile)
    try:
        result = cx.auto_run("UNWIND range(1, 5) AS n RETURN n", pull=3)
    except IndexError as error:
        skip(str(error))
    else:
        assert result.take() == [1]
        assert result.take() == [2]
        assert result.take() == [3]
        assert result.take() is None
        cx.pull(result)
        assert result.take() == [4]
        assert result.take() == [5]
        assert result.take() is None
    finally:
        cx.close()