コード例 #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
ファイル: file_age.py プロジェクト: mcara/pandokia
def day_older_f():
    fc.assert_file_older('1d', days=3)
コード例 #3
0
ファイル: file_age.py プロジェクト: mcara/pandokia
def day_older_p():
    fc.assert_file_older('1d', days=1)
コード例 #4
0
ファイル: file_age.py プロジェクト: mcara/pandokia
def hour_older_f():
    fc.assert_file_older('60m', hours=1.25)
コード例 #5
0
ファイル: file_age.py プロジェクト: mcara/pandokia
def hour_older_p():
    fc.assert_file_older('60m', hours=0.75)
コード例 #6
0
ファイル: file_age.py プロジェクト: mcara/pandokia
def f_older_f():
    fc.assert_file_older('30m', '60m')
コード例 #7
0
ファイル: file_age.py プロジェクト: mcara/pandokia
def f_older_p():
    fc.assert_file_older('60m', '30m')