From 7058290c2e549e6374a33184d72f9d6556ff4cdf Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Wed, 28 Jul 2010 15:23:16 +0200 Subject: [PATCH] test suite: remove incomplete MH testing code I just discovered that archivemails MH support is broken with respect to message flags, and in my opinion it doesn't make much sense to test known-broken functionality. In fact there may well be zero archivemail users with MH mailboxes; MH is basically an obsolete format, and any archivemail user with MH mailboxes would probably have complained about lost message flags. --- test_archivemail.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/test_archivemail.py b/test_archivemail.py index 5186de0..c2fe5d2 100755 --- a/test_archivemail.py +++ b/test_archivemail.py @@ -112,7 +112,7 @@ make_msgid = MessageIdFactory() class IndexedMailboxDir: """An indexed mailbox directory, providing random message access by - message-id. Base class for a maildir and an mh subclass.""" + message-id. Intended as a base class for a maildir and an mh subclass.""" def __init__(self, mdir_name): assert tempfile.tempdir @@ -220,37 +220,6 @@ class SimpleMaildir(IndexedMailboxDir): return msg, mbox_flags -class SimpleMHMailbox(IndexedMailboxDir): - """Primitive MH mailbox class, just good enough for generating short-lived - test mh mailboxes.""" - - def __init__(self, mdir_name='mh'): - IndexedMailboxDir.__init__(self, mdir_name) - - def write(self, msg_str): - self.deliveries += 1 - fname = str(self.deliveries) - path = os.path.join(self.root, fname) - assert not os.path.exists(fpath) - f = open(path, "w") - f.write(msg_str) - f.close() - self._add_to_index(msg_str, fname) - - def remove(self): - self.clear() - os.rmdir(self.root) - self.root = None - - def get_message(self, msgid): - """For the Message-Id msgid, return the matching message in text - format.""" - fpath = self.msg_id_dict[mid] # Barfs if not found - fp = open(os.path.join(self.root, fpath), "r") - msg_str = fp.read() - fp.close() - return msg_str - class TestCaseInTempdir(unittest.TestCase): """Base class for testcases that need to create temporary files. All testcases that create temporary files should be derived from this