mirror of
https://git.code.sf.net/p/archivemail/code
synced 2024-12-22 07:42:55 +00:00
test suite: test weird message headers in one run
Before, every test header was tested in a separate archiving run.
This commit is contained in:
parent
573cbbce91
commit
232b2256c2
1 changed files with 12 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue