예제 #1
0
def test_plot_graph(config):
    img_file = config['output']
    if os.path.exists(config['output']):
        os.remove(img_file)

    grapher = LookMlGrapher(config)
    grapher.node_map['model_a'] = NodeType.MODEL
    grapher.node_map['explore_a'] = NodeType.EXPLORE
    grapher.node_map['view_a'] = NodeType.VIEW
    grapher.node_map['orphan'] = NodeType.VIEW
    grapher.models_to_explores.append(('model_a', 'explore_a'))
    grapher.explores_to_views.append(('explore_a', 'view_a'))
    grapher.tag_orphans()
    g = grapher.create_graph()

    grapher.plot_graph(g, img_file, "some title")

    assert os.path.exists(img_file)

    if os.path.exists(config['output']):
        os.remove(img_file)
예제 #2
0
def test_plot_graph(config):
    img_file = config["output"]
    if os.path.exists(config["output"]):
        os.remove(img_file)

    grapher = LookMlGrapher(config)
    grapher.node_map["model_a"] = NodeType.MODEL
    grapher.node_map["explore_a"] = NodeType.EXPLORE
    grapher.node_map["view_a"] = NodeType.VIEW
    grapher.node_map["orphan"] = NodeType.VIEW
    grapher.models_to_explores.append(("model_a", "explore_a"))
    grapher.explores_to_views.append(("explore_a", "view_a"))
    grapher.tag_orphans()
    g = grapher.create_graph()

    grapher.plot_graph(g, img_file, "some title")

    assert os.path.exists(img_file)

    if os.path.exists(config["output"]):
        os.remove(img_file)