예제 #1
0
def test_delete_successor():
    comp = Computation()
    comp.add_node('a')
    comp.add_node('b', lambda a: a + 1)
    comp.insert('a', 1)
    comp.compute_all()
    assert comp['a'] == (States.UPTODATE, 1)
    assert comp['b'] == (States.UPTODATE, 2)
    comp.delete_node('b')
    assert comp['a'] == (States.UPTODATE, 1)
    assert list(comp.dag.nodes()) == ['a']
    comp.delete_node('a')
    assert list(comp.dag.nodes()) == []
예제 #2
0
def test_delete_nonexistent_causes_exception():
    comp = Computation()
    comp.delete_node('a')
예제 #3
0
def test_delete_node_with_placeholder_parent():
    comp = Computation()
    comp.add_node('b', lambda a: a)
    comp.delete_node('b')