예제 #1
0
def test_nodegraph_is_done__output_changes(temp_folder):
    temp_file_1 = os.path.join(temp_folder, "file_1.txt")
    temp_file_2 = os.path.join(temp_folder, "file_2.txt")
    my_node = flexmock(output_files=(temp_file_1, temp_file_2))
    assert not NodeGraph._is_done(my_node, FileStatusCache())
    set_file_contents(temp_file_1, "foo")
    assert not NodeGraph._is_done(my_node, FileStatusCache())
    set_file_contents(temp_file_2, "bar")
    assert NodeGraph._is_done(my_node, FileStatusCache())
예제 #2
0
def test_nodegraph_is_done__subnode_not_considered(temp_folder):
    temp_file = os.path.join(temp_folder, "file.txt")
    subnode = flexmock(output_files=(temp_file,))
    my_node = flexmock(output_files=(),
                       subnodes=(subnode,))
    assert NodeGraph._is_done(my_node, FileStatusCache())
예제 #3
0
def test_nodegraph_is_done__no_output():
    cache = FileStatusCache()
    node = flexmock(output_files=())
    assert NodeGraph._is_done(node, cache)