From 573cbbce917e4b715f22e102dd9925e7ce96f6ea Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Tue, 30 Sep 2008 12:55:40 +0200 Subject: test suite: cut down the test of date header processing Don't do entire test archiving runs, just call archivemail.should_archive(). --- test_archivemail.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/test_archivemail.py b/test_archivemail.py index 1fefff3..e5020ec 100755 --- a/test_archivemail.py +++ b/test_archivemail.py @@ -536,25 +536,13 @@ This is after the ^From line""" }, ) for headers in test_headers: + msg = make_message(default_headers=headers, wantobj=True) date = time.strptime("2000-07-29", "%Y-%m-%d") archivemail.options.date_old_max = time.mktime(date) - self.mbox_name = make_mbox(messages=3, headers=headers) - self.copy_name = tempfile.mkstemp()[1] - shutil.copyfile(self.mbox_name, self.copy_name) - archivemail.archive(self.mbox_name) - assert(os.path.exists(self.mbox_name)) - self.assertEqual(os.path.getsize(self.mbox_name), 0) - archive_name = self.mbox_name + "_archive.gz" - assertEqualContent(archive_name, self.copy_name, zipfirst=True) + assert(archivemail.should_archive(msg)) date = time.strptime("2000-07-27", "%Y-%m-%d") archivemail.options.date_old_max = time.mktime(date) - self.mbox_name = make_mbox(messages=3, headers=headers) - self.copy_name = tempfile.mkstemp()[1] - shutil.copyfile(self.mbox_name, self.copy_name) - archivemail.archive(self.mbox_name) - assertEqualContent(self.mbox_name, self.copy_name) - archive_name = self.mbox_name + "_archive.gz" - assert(not os.path.exists(archive_name)) + assert(not archivemail.should_archive(msg)) def testMixed(self): """archiving a mixed mailbox""" -- cgit v1.2.3