def test_build_granular_target_with_outs(repo):
    G = _build(repo, target="h", outs=True)
    assert set(G.nodes()) == {"a", "b", "h"}
    assert set(G.edges()) == {
        ("h", "a"),
        ("h", "b"),
    }
Exemple #2
0
def test_build_target_with_outs(graph):
    (stage, ) = filter(lambda s: hasattr(s, "name") and s.name == "3",
                       graph.nodes())
    G = _build(graph, target=stage, outs=True)
    assert set(G.nodes()) == {"a", "b", "h", "i"}
    assert set(G.edges()) == {
        ("h", "a"),
        ("h", "b"),
        ("i", "a"),
        ("i", "b"),
    }
def test_build_full_outs(repo, granular):
    target = "h" if granular else "3"
    G = _build(repo, target=target, outs=True, full=True)
    assert set(G.nodes()) == {"j", "i", "d", "b", "g", "f", "e", "a", "h"}
    assert set(G.edges()) == {
        ("d", "a"),
        ("e", "a"),
        ("f", "b"),
        ("g", "b"),
        ("h", "a"),
        ("h", "b"),
        ("i", "a"),
        ("i", "b"),
        ("j", "a"),
        ("j", "h"),
    }
Exemple #4
0
def test_build_full(graph):
    (stage, ) = filter(lambda s: hasattr(s, "name") and s.name == "3",
                       graph.nodes())
    G = _build(graph, target=stage, full=True)
    assert nx.is_isomorphic(G, graph)
Exemple #5
0
def test_build_target(graph):
    (stage, ) = filter(lambda s: hasattr(s, "name") and s.name == "3",
                       graph.nodes())
    G = _build(graph, target=stage)
    assert set(G.nodes()) == {"3", "b.dvc", "a.dvc"}
    assert set(G.edges()) == {("3", "a.dvc"), ("3", "b.dvc")}
Exemple #6
0
def test_build(graph):
    assert nx.is_isomorphic(_build(graph), graph)
def test_build_full(repo):
    G = _build(repo, target="3", full=True)
    assert nx.is_isomorphic(G, repo.graph)
def test_build_target(repo):
    G = _build(repo, target="3")
    assert set(G.nodes()) == {"3", "b.dvc", "a.dvc"}
    assert set(G.edges()) == {("3", "a.dvc"), ("3", "b.dvc")}
def test_build(repo):
    assert nx.is_isomorphic(_build(repo), repo.graph)