def test_modified_after__same_file(): assert not modified_after("tests/data/timestamp_a_older", "tests/data/timestamp_a_older") assert not modified_after("tests/data/timestamp_a_older", "tests/data/timestamp_b_older") assert not modified_after("tests/data/timestamp_b_older", "tests/data/timestamp_a_older")
def test_modified_after__not_modified_after(): assert not modified_after("tests/data/timestamp_a_older", "tests/data/timestamp_a_younger") assert not modified_after("tests/data/timestamp_a_older", "tests/data/timestamp_b_younger") assert not modified_after("tests/data/timestamp_b_older", "tests/data/timestamp_a_younger")
def is_outdated(self): """Returns true if the output exists (is_done == True), but one or more of the intput files appear to have been changed since the creation of the output files (based on the timestamps). A node that lacks either input or output files is never considered outdated.""" if not self.is_done: return False elif not (self.input_files and self.output_files): return False return fileutils.modified_after(self.input_files, self.output_files)