From a7414319c9d21f271d75e82cb3efa2e3ceffaa68 Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Sat, 9 Aug 2008 02:56:19 +0200 Subject: Simplify the final committing of the mailbox and archive * Make the finalise() methods spot if they have anything to do * We used to create the temporary mbox files on demand in the message processing loop, if we needed to write to them. Now we create them beforehand, but only if they might be needed (e.g. we don't create an archive if options.delete_old_mail is set). * The above combined makes the final committing of the changes simpler (a *lot* simpler for mboxes), and we can dump the Mbox.leave_empty() method. --- test_archivemail.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'test_archivemail.py') diff --git a/test_archivemail.py b/test_archivemail.py index 4465ad4..8cbf152 100755 --- a/test_archivemail.py +++ b/test_archivemail.py @@ -99,21 +99,6 @@ class TestCaseInTempdir(unittest.TestCase): ############ Mbox Class testing ############## -class TestMboxLeaveEmpty(TestCaseInTempdir): - def setUp(self): - super(TestMboxLeaveEmpty, self).setUp() - self.mbox_name = make_mbox() - self.mbox_mode = os.stat(self.mbox_name)[stat.ST_MODE] - self.mbox = archivemail.Mbox(self.mbox_name) - - def testLeaveEmpty(self): - """leave_empty should leave a zero-length file""" - self.mbox.leave_empty() - assert(os.path.isfile(self.mbox_name)) - self.assertEqual(os.path.getsize(self.mbox_name), 0) - new_mode = os.stat(self.mbox_name)[stat.ST_MODE] - self.assertEqual(new_mode, self.mbox_mode) - class TestMboxProcmailLock(TestCaseInTempdir): def setUp(self): super(TestMboxProcmailLock, self).setUp() -- cgit v1.2.3