aboutsummaryrefslogtreecommitdiffstats
path: root/test_archivemail.py
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2008-08-09 02:56:19 +0200
committerNikolaus Schulz <microschulz@web.de>2010-07-19 01:13:24 +0200
commita7414319c9d21f271d75e82cb3efa2e3ceffaa68 (patch)
treeaa9762cba75791bcb8406957c911d0496b62902d /test_archivemail.py
parentb37b3d627e1292f33dbf7bc44a7840ba15d72057 (diff)
downloadarchivemail-a7414319c9d21f271d75e82cb3efa2e3ceffaa68.tar.gz
archivemail-a7414319c9d21f271d75e82cb3efa2e3ceffaa68.tar.bz2
archivemail-a7414319c9d21f271d75e82cb3efa2e3ceffaa68.zip
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.
Diffstat (limited to 'test_archivemail.py')
-rwxr-xr-xtest_archivemail.py15
1 files changed, 0 insertions, 15 deletions
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()