示例#1
0
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"
示例#2
0
def day_older_f():
    fc.assert_file_older('1d', days=3)
示例#3
0
def day_older_p():
    fc.assert_file_older('1d', days=1)
示例#4
0
def hour_older_f():
    fc.assert_file_older('60m', hours=1.25)
示例#5
0
def hour_older_p():
    fc.assert_file_older('60m', hours=0.75)
示例#6
0
def f_older_f():
    fc.assert_file_older('30m', '60m')
示例#7
0
def f_older_p():
    fc.assert_file_older('60m', '30m')