def assert_file_older(): with pycode.test("rel"): with pycode.test("is"): filecomp.assert_file_older('times_o', 'times_n') with pycode.test("not"): try: filecomp.assert_file_older('times_n', 'times_o') except AssertionError: pass else: assert 0, "should have had AssertionError" with pycode.test("abs"): with pycode.test("is"): filecomp.assert_file_older('times_o', hours=8) filecomp.assert_file_older('times_n', hours=3) with pycode.test("not"): try: filecomp.assert_file_older('times_n', hours=8) except AssertionError: pass else: assert 0, "should have had AssertionError"
def day_older_f(): fc.assert_file_older('1d', days=3)
def day_older_p(): fc.assert_file_older('1d', days=1)
def hour_older_f(): fc.assert_file_older('60m', hours=1.25)
def hour_older_p(): fc.assert_file_older('60m', hours=0.75)
def f_older_f(): fc.assert_file_older('30m', '60m')
def f_older_p(): fc.assert_file_older('60m', '30m')