mirror of
https://git.code.sf.net/p/archivemail/code
synced 2025-03-11 23:32:48 +00:00
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.
This commit is contained in:
parent
0dfae37e04
commit
7058290c2e
1 changed files with 1 additions and 32 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue