diff options
| author | Barry Warsaw | 2007-12-10 23:00:14 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2007-12-10 23:00:14 -0500 |
| commit | 7923b90f0349f9e2dc891082e2e1c3bf23b4d79c (patch) | |
| tree | 35ce2b0d149f8f806d84e0b8e991213d073df193 /Mailman/tests/test_documentation.py | |
| parent | 5495accf05d77e1c4ff2855f5e42c2e56f51e45d (diff) | |
| download | mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.tar.gz mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.tar.zst mailman-7923b90f0349f9e2dc891082e2e1c3bf23b4d79c.zip | |
Add .get() to our Message subclass, which ensures that returned
values are unicodes if they come from the base class as a string.
Get rid of the 'global id'. Now use just Message-ID. Rename
X-List-ID-Hash to X-Message-ID-Hash. Do not take Date header into
account when calculating this hash.
Because of the above change, the assumption is that there will be no
Message-ID collisions. Therefore, get rid of IMessageStore
.get_message(), .get_messages_by_message_id() and
.get_messages_by_hash(). Instead, it's now .get_message_by_id() and
.get_message_by_hash() both of which return the message object or
None.
Message.hash -> Message.message_id_hash
When storing a message in the message store, the final path component
has the entire hash, not just the leftover parts after directory
prefix splitting.
MessageStore.delete_message() deletes the file too.
Doctests clean up message store messages though the message store
instead of directly off the filesystem.
Diffstat (limited to 'Mailman/tests/test_documentation.py')
| -rw-r--r-- | Mailman/tests/test_documentation.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Mailman/tests/test_documentation.py b/Mailman/tests/test_documentation.py index 575d8e6bd..390ba6a66 100644 --- a/Mailman/tests/test_documentation.py +++ b/Mailman/tests/test_documentation.py @@ -58,10 +58,9 @@ def cleaning_teardown(testobj): for dirpath, dirnames, filenames in os.walk(config.QUEUE_DIR): for filename in filenames: os.remove(os.path.join(dirpath, filename)) - # Clear out messages in the message store directory. - for dirpath, dirnames, filenames in os.walk(config.MESSAGES_DIR): - for filename in filenames: - os.remove(os.path.join(dirpath, filename)) + # Clear out messages in the message store. + for message in config.db.message_store.messages: + config.db.message_store.delete_message(message['message-id']) |
