aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2008-09-30 12:55:40 +0200
committerNikolaus Schulz <microschulz@web.de>2010-07-19 01:13:24 +0200
commit573cbbce917e4b715f22e102dd9925e7ce96f6ea (patch)
treed3430f9d8667fab3859c8824df95d4956b0b443b
parente9d2284a077e6ca4fe3d88dced75d771465ca931 (diff)
downloadarchivemail-573cbbce917e4b715f22e102dd9925e7ce96f6ea.tar.gz
archivemail-573cbbce917e4b715f22e102dd9925e7ce96f6ea.tar.bz2
archivemail-573cbbce917e4b715f22e102dd9925e7ce96f6ea.zip
test suite: cut down the test of date header processing
Don't do entire test archiving runs, just call archivemail.should_archive().
-rwxr-xr-xtest_archivemail.py18
1 files 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"""