From 0599193ba57fd164f6b3da82b82c56216974e3a3 Mon Sep 17 00:00:00 2001 From: Michael Krayer Date: Fri, 22 May 2020 11:12:24 +0200 Subject: [PATCH] fixed remaining test: they failed much less often --- test_archivemail | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_archivemail b/test_archivemail index dd68318..4f90519 100755 --- a/test_archivemail +++ b/test_archivemail @@ -501,15 +501,17 @@ class TestOptionParser(unittest.TestCase): class TestIsTooOld(unittest.TestCase): def testVeryOld(self): """with max_days=360, should be true for these dates > 1 year""" + ctime = time.time() for years in range(1, 10): - time_msg = time.time() - (years * 365 * 24 * 60 * 60) + time_msg = ctime - (years * 365 * 24 * 60 * 60) assert archivemail.is_older_than_days(time_message=time_msg, max_days=360) def testOld(self): """with max_days=14, should be true for these dates > 14 days""" + ctime = time.time() for days in range(14, 360): - time_msg = time.time() - (days * 24 * 60 * 60) + time_msg = ctime - (days * 24 * 60 * 60) assert archivemail.is_older_than_days(time_message=time_msg, max_days=14)