示例#1
0
def test_update_graph_layout(graph_id, layout_id):
    graphspace = GraphSpace('*****@*****.**', 'user1')
    graphspace.set_api_host('localhost:8000')
    response = graphspace.update_graph_layout(
        graph_id=graph_id,
        layout_id=layout_id,
        layout_name='updated test layout',
        is_shared=1)
    assert response is not None and response['is_shared'] == 1 and response[
        'name'] == 'updated test layout'
示例#2
0
def test_update_graph_layout(graph_id, layout_id):
    graphspace = GraphSpace('*****@*****.**', 'user1')
    layout = graphspace.get_graph_layout(graph_id=graph_id,
                                         layout_id=layout_id)
    layout.set_node_position('z', 74, 37)
    layout.set_is_shared()
    layout1 = graphspace.update_graph_layout(layout)
    assert type(layout1) is Layout
    assert layout1.get_name() == layout.get_name()
    assert 'z' in layout1.positions_json
    assert layout1.is_shared == 1
示例#3
0
def test_update_graph_layout2(graph_id, name):
    graphspace = GraphSpace('*****@*****.**', 'user1')
    L = GSLayout()
    L.set_node_position('b', y=38.5, x=67.3)
    L.set_node_position('a', y=102, x=238.1)
    L.add_node_style('a', shape='octagon', color='green', width=60, height=60)
    L.add_edge_style('a', 'b', directed=True, edge_style='solid')
    L.set_name(name)
    L.set_is_shared()
    layout = graphspace.update_graph_layout(graph_id=graph_id, layout=L)
    assert type(layout) is Layout
    assert layout.get_name() == L.get_name()
    assert layout.is_shared == 1