示例#1
0
def test_draw_plotly_network():
    c1 = BaseComponent("c1")
    c2 = BaseComponent("c2")
    c3 = BaseComponent("c3")
    c2.parent_component_list = [c1]
    c2.child_component_list = [c3]
    product = BaseProduct([c3, c2, c1])
    product.draw_plotly_network(save_fig_path="test.png")
    if os.path.exists("test.png"):
        os.remove("test.png")
示例#2
0
def test_draw_plotly_network(tmpdir):
    """test_draw_plotly_network."""
    c1 = BaseComponent("c1")
    c2 = BaseComponent("c2")
    c3 = BaseComponent("c3")
    c2.parent_component_list = [c1]
    c2.child_component_list = [c3]
    product = BaseProduct([c3, c2, c1])
    for ext in ["png", "html", "json"]:
        save_fig_path = os.path.join(str(tmpdir), "test." + ext)
        product.draw_plotly_network(save_fig_path=save_fig_path)