def test_draw_networkx(): 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_networkx(save_fig_path="test.png") if os.path.exists("test.png"): os.remove("test.png")
def test_draw_networkx(tmpdir): """test_draw_networkx.""" 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"]: save_fig_path = os.path.join(str(tmpdir), "test." + ext) product.draw_networkx(save_fig_path=save_fig_path)