diff options
author | Nikolaus Schulz <microschulz@web.de> | 2008-09-30 13:07:19 +0200 |
---|---|---|
committer | Nikolaus Schulz <microschulz@web.de> | 2010-07-19 01:13:24 +0200 |
commit | 232b2256c2d159b7aab0608d169ddf555bbdc4e3 (patch) | |
tree | a6c4abcc890708d9fbc72c407a4388523b58dea4 | |
parent | 573cbbce917e4b715f22e102dd9925e7ce96f6ea (diff) | |
download | archivemail-232b2256c2d159b7aab0608d169ddf555bbdc4e3.tar.gz archivemail-232b2256c2d159b7aab0608d169ddf555bbdc4e3.tar.bz2 archivemail-232b2256c2d159b7aab0608d169ddf555bbdc4e3.zip |
test suite: test weird message headers in one run
Before, every test header was tested in a separate archiving run.
-rwxr-xr-x | test_archivemail.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test_archivemail.py b/test_archivemail.py index e5020ec..a5f7c21 100755 --- a/test_archivemail.py +++ b/test_archivemail.py @@ -631,15 +631,19 @@ This is after the ^From line""" 'Resent-Date' : '', }, ) + fd, self.mbox_name = tempfile.mkstemp() + fp = os.fdopen(fd, "w") for headers in weird_headers: - 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) + msg_text = make_message(default_headers=headers) + fp.write(msg_text*2) + fp.close() + 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) def tearDown(self): archivemail.options = self.oldopts |