mirror of
https://git.code.sf.net/p/archivemail/code
synced 2024-12-22 07:42:55 +00:00
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.
This commit is contained in:
parent
7058290c2e
commit
2ce89ef508
1 changed files with 0 additions and 17 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue