Esempio n. 1
0
def test_error_on_operation_on_graph(graphscope_session):
    g = Graph(graphscope_session)
    with pytest.raises(RuntimeError, match="Empty graph"):
        g.project_to_simple(v_label=0, v_prop=0, e_label=0, e_prop=0)

    with pytest.raises(RuntimeError):
        property_sssp(g, src=6)
Esempio n. 2
0
def test_error_on_operation_on_graph(graphscope_session):
    g = Graph(graphscope_session.session_id)
    with pytest.raises(RuntimeError,
                       match="The graph is not registered in remote"):
        g.project_to_simple(v_label=0, v_prop=0, e_label=0, e_prop=0)

    with pytest.raises(RuntimeError,
                       match="The graph is not registered in remote"):
        g.unload()

    with pytest.raises(AssertionError):
        property_sssp(g, src=6)
Esempio n. 3
0
def test_unload(graphscope_session):
    graph = Graph(graphscope_session)
    prefix = os.path.expandvars("${GS_TEST_DIR}/property")
    graph = (Graph(graphscope_session).add_vertices(
        f"{prefix}/p2p-31_property_v_0",
        "person").add_edges(f"{prefix}/p2p-31_property_e_0", "knows"))
    assert graph.loaded()
    assert graph.vineyard_id is not None
    graph.unload()

    assert not graph.loaded()

    with pytest.raises(RuntimeError, match="The graph is not loaded"):
        graph.unload()

    with pytest.raises(RuntimeError, match="The graph is not loaded"):
        graph.project_to_simple(v_label="person", e_label="knows")
    with pytest.raises(AssertionError):
        g2 = Graph(graphscope_session, graph)
    with pytest.raises(RuntimeError, match="The graph is not loaded"):
        property_sssp(graph, src=6)