From 2ce89ef5085957418fe7f1a65c77425a5a3c11ee Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Fri, 21 Nov 2008 15:17:48 +0100 Subject: test suite: remove unused remove() methods from maildir classes For cleanup of temporary files, we lean on shutil.rmtree anyway, so don't bother wasting more code on this. --- test_archivemail.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/test_archivemail.py b/test_archivemail.py index c2fe5d2..665cf9c 100755 --- a/test_archivemail.py +++ b/test_archivemail.py @@ -60,7 +60,6 @@ import unittest import gzip import cStringIO import rfc822 -import errno import mailbox try: @@ -144,14 +143,6 @@ class IndexedMailboxDir: """Return all relative pathnames of files in this mailbox.""" return self.msg_id_dict.values() - def clear(self): - """Remove all messages in this mailbox.""" - for relpath in self.msg_id_dict.values(): - try: os.remove(os.path.join(self.root, relpath)) - except OSError, e: - if e.errno != errno.ENOENT: raise - self.msg_id_dict.clear() - class SimpleMaildir(IndexedMailboxDir): """Primitive Maildir class, just good enough for generating short-lived test maildirs.""" @@ -177,14 +168,6 @@ class SimpleMaildir(IndexedMailboxDir): f.close() self._add_to_index(msg_str, relpath) - def remove(self): - """Remove all files and directories that comprise this mailbox.""" - self.clear() - for d in "cur", "new", "tmp": - os.rmdir(os.path.join(self.root, d)) - os.rmdir(self.root) - self.root = None - def _mkname(self, new, flags): """Generate a unique filename for a new message.""" validflags = 'DFPRST' -- cgit v1.2.3