示例#1
0
def test_post_graph_layout(graph_id):
    graphspace = GraphSpace('*****@*****.**', 'user1')
    graphspace.set_api_host('localhost:8000')
    response = graphspace.post_graph_layout(graph_id=graph_id,
                                            layout_name='test layout')
    assert response is not None and response['is_shared'] == 0
    return response
示例#2
0
def test_post_graph_layout(graph_id, name=None):
    graphspace = GraphSpace('*****@*****.**', 'user1')
    layout1 = GSLayout()
    if name is not None:
        layout1.set_name(name)
    layout1.set_node_position('a', 45, 55)
    layout1.set_node_position('b', 36, 98)
    layout1.add_node_style('a',
                           shape='ellipse',
                           color='green',
                           width=90,
                           height=90)
    layout1.add_node_style('b',
                           shape='ellipse',
                           color='yellow',
                           width=40,
                           height=40)
    layout = graphspace.post_graph_layout(graph_id=graph_id, layout=layout1)
    assert type(layout) is Layout
    assert layout.get_name() == layout1.get_name()
    return layout