Ejemplo n.º 1
0
def test_proctree_getends(set2):

    # p15 -> p16  ->  p17 -> 19
    # p14 _/  \_ p18_/  \_ p20
    #           hide
    pt = ProcTree()
    pt.init()
    pt.setStarts([set2.p14, set2.p15])
    assert set(pt.getEnds()) == {set2.p19, set2.p20}
    assert set(pt.ends) == {set2.p19, set2.p20}
    assert set(pt.getEnds()) == {set2.p19, set2.p20}

    #set2.p19.hide = True
    pt.ends = []
Ejemplo n.º 2
0
def test_proctree_setgetstarts():
    p12 = Proc()
    p13 = Proc()
    p14 = Proc()
    #p14.hide = True
    p12.depends = p13
    ProcTree.register(p13)
    ProcTree.register(p14)
    pt = ProcTree()
    pt.init()
    # with pytest.raises(ProcHideError):
    # 	pt.setStarts([p14])
    pt.ends = [1, 2, 3]
    pt.setStarts([p13])
    assert ProcTree.NODES[p12].start == False
    assert ProcTree.NODES[p13].start == True
    assert ProcTree.NODES[p14].start == False
    assert pt.starts == [p13]
    assert pt.ends == []

    pt.starts = []
    assert pt.getStarts() == [p13]
    assert pt.starts == [p13]
    assert pt.getStarts() == [p13]