diff options
author | Nikolaus Schulz <microschulz@web.de> | 2010-07-28 15:23:16 +0200 |
---|---|---|
committer | Nikolaus Schulz <microschulz@web.de> | 2010-07-29 15:46:15 +0200 |
commit | 7058290c2e549e6374a33184d72f9d6556ff4cdf (patch) | |
tree | 6dee8fba33b880cbfb3faf1951c3d05584e4e0cd | |
parent | 0dfae37e04477a1ddd88f7da149171400c90fa57 (diff) | |
download | archivemail-7058290c2e549e6374a33184d72f9d6556ff4cdf.tar.gz archivemail-7058290c2e549e6374a33184d72f9d6556ff4cdf.tar.bz2 archivemail-7058290c2e549e6374a33184d72f9d6556ff4cdf.zip |
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.
-rwxr-xr-x | test_archivemail.py | 33 |
1 files changed, 1 insertions, 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 |