summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2007-11-10 13:14:51 -0500
committerBarry Warsaw2007-11-10 13:14:51 -0500
commit58b8ca1c929c5bc0ea1b36fb5e6e683a8830e963 (patch)
tree4d87cdececa390c0bcc1460f60c6102e0e81f87d
parent3d7b9702e4ff97f86025f8d7ae9b29220f5bf264 (diff)
downloadmailman-58b8ca1c929c5bc0ea1b36fb5e6e683a8830e963.tar.gz
mailman-58b8ca1c929c5bc0ea1b36fb5e6e683a8830e963.tar.zst
mailman-58b8ca1c929c5bc0ea1b36fb5e6e683a8830e963.zip
All the simple test fixes are now in, and while there are still some failing
tests, we're making very good progress. Just the tough ones are left. This change did modify the the schema a bit, for better naming and typing. E.g. 'type' -> 'request_type' and using a RawStr for a hash type.
-rw-r--r--Mailman/database/listmanager.py5
-rw-r--r--Mailman/database/messagestore.py29
-rw-r--r--Mailman/database/model/mailman.sql2
-rw-r--r--Mailman/database/model/message.py15
-rw-r--r--Mailman/database/model/pending.py2
-rw-r--r--Mailman/database/model/requests.py39
-rw-r--r--Mailman/docs/hold.txt11
-rw-r--r--Mailman/docs/lifecycle.txt8
-rw-r--r--Mailman/docs/listmanager.txt26
-rw-r--r--Mailman/docs/message.txt2
-rw-r--r--Mailman/docs/messagestore.txt2
-rw-r--r--Mailman/docs/nntp.txt12
-rw-r--r--Mailman/docs/outgoing.txt19
-rw-r--r--Mailman/docs/requests.txt13
-rw-r--r--Mailman/docs/runner.txt3
-rw-r--r--Mailman/docs/switchboard.txt8
16 files changed, 109 insertions, 87 deletions
diff --git a/Mailman/database/listmanager.py b/Mailman/database/listmanager.py
index eb1ce6ba2..48e7fe62c 100644
--- a/Mailman/database/listmanager.py
+++ b/Mailman/database/listmanager.py
@@ -43,6 +43,7 @@ class ListManager(object):
raise Errors.MMListAlreadyExistsError(fqdn_listname)
mlist = MailingList(fqdn_listname)
mlist.created_at = datetime.datetime.now()
+ config.db.store.add(mlist)
return mlist
def delete(self, mlist):
@@ -69,5 +70,7 @@ class ListManager(object):
@property
def names(self):
- for mlist in MailingList.query.filter_by().all():
+ # Avoid circular imports.
+ from Mailman.database.model import MailingList
+ for mlist in config.db.store.find(MailingList):
yield fqdn_listname(mlist.list_name, mlist.host_name)
diff --git a/Mailman/database/messagestore.py b/Mailman/database/messagestore.py
index 87f2fc828..7c90918ac 100644
--- a/Mailman/database/messagestore.py
+++ b/Mailman/database/messagestore.py
@@ -68,10 +68,9 @@ class MessageStore:
# providing a unique serial number, but to get this information, we
# have to use a straight insert instead of relying on Elixir to create
# the object.
- result = Message.table.insert().execute(
- hash=hash32, path=relpath, message_id=message_id)
+ row = Message(hash=hash32, path=relpath, message_id=message_id)
# Add the additional header.
- seqno = result.last_inserted_ids()[0]
+ seqno = row.id
del message['X-List-Sequence-Number']
message['X-List-Sequence-Number'] = str(seqno)
# Now calculate the full file system path.
@@ -97,11 +96,21 @@ class MessageStore:
return pickle.load(fp)
def get_messages_by_message_id(self, message_id):
- for msgrow in Message.query.filter_by(message_id=message_id):
+ # Avoid circular imports.
+ from Mailman.database.model.message import Message
+ for msgrow in config.db.store.find(Message, message_id=message_id):
yield self._msgobj(msgrow)
def get_messages_by_hash(self, hash):
- for msgrow in Message.query.filter_by(hash=hash):
+ # Avoid circular imports.
+ from Mailman.database.model.message import Message
+ # It's possible the hash came from a message header, in which case it
+ # will be a Unicode. However when coming from source code, it will
+ # always be an 8-string. Coerce to the latter if necessary; it must
+ # be US-ASCII.
+ if isinstance(hash, unicode):
+ hash = hash.encode('ascii')
+ for msgrow in config.db.store.find(Message, hash=hash):
yield self._msgobj(msgrow)
def _getmsg(self, global_id):
@@ -110,7 +119,9 @@ class MessageStore:
seqno = int(seqno)
except ValueError:
return None
- messages = Message.query.filter_by(id=seqno)
+ # Avoid circular imports.
+ from Mailman.database.model.message import Message
+ messages = config.db.store.find(Message, id=seqno)
if messages.count() == 0:
return None
assert messages.count() == 1, 'Multiple id matches'
@@ -126,11 +137,13 @@ class MessageStore:
@property
def messages(self):
- for msgrow in Message.query.filter_by().all():
+ # Avoid circular imports.
+ from Mailman.database.model.message import Message
+ for msgrow in config.db.store.find(Message):
yield self._msgobj(msgrow)
def delete_message(self, global_id):
msgrow = self._getmsg(global_id)
if msgrow is None:
raise KeyError(global_id)
- msgrow.delete()
+ config.db.store.remove(msgrow)
diff --git a/Mailman/database/model/mailman.sql b/Mailman/database/model/mailman.sql
index 3dabad8c6..a20b1b118 100644
--- a/Mailman/database/model/mailman.sql
+++ b/Mailman/database/model/mailman.sql
@@ -1,7 +1,7 @@
CREATE TABLE _request (
id INTEGER NOT NULL,
"key" TEXT,
- type TEXT,
+ request_type TEXT,
data_hash TEXT,
mailing_list_id INTEGER,
PRIMARY KEY (id),
diff --git a/Mailman/database/model/message.py b/Mailman/database/model/message.py
index 7a6d7371a..c4ea4a636 100644
--- a/Mailman/database/model/message.py
+++ b/Mailman/database/model/message.py
@@ -18,6 +18,7 @@
from storm.locals import *
from zope.interface import implements
+from Mailman.configuration import config
from Mailman.database import Model
from Mailman.interfaces import IMessage
@@ -28,8 +29,14 @@ class Message(Model):
implements(IMessage)
- id = Int(primary=True)
- hash = Unicode()
- path = Unicode()
- # This is a Messge-ID field representation, not a database row id.
+ id = Int(primary=True, default=AutoReload)
message_id = Unicode()
+ hash = RawStr()
+ path = RawStr()
+ # This is a Messge-ID field representation, not a database row id.
+
+ def __init__(self, message_id, hash, path):
+ self.message_id = message_id
+ self.hash = hash
+ self.path = path
+ config.db.store.add(self)
diff --git a/Mailman/database/model/pending.py b/Mailman/database/model/pending.py
index 970e3c16e..be180d7f2 100644
--- a/Mailman/database/model/pending.py
+++ b/Mailman/database/model/pending.py
@@ -110,7 +110,7 @@ class Pendings(object):
return token
def confirm(self, token, expunge=True):
- pendings = Pended.query.filter_by(token=token)
+ pendings = config.db.store.find(Pended, token=token)
if pendings.count() == 0:
return None
assert pendings.count() == 1, (
diff --git a/Mailman/database/model/requests.py b/Mailman/database/model/requests.py
index 5e92e70b2..0817388e3 100644
--- a/Mailman/database/model/requests.py
+++ b/Mailman/database/model/requests.py
@@ -53,7 +53,7 @@ class ListRequests:
def count_of(self, request_type):
return config.db.store.find(
_Request,
- mailing_list=self.mailing_list, type=request_type).count()
+ mailing_list=self.mailing_list, request_type=request_type).count()
@property
def held_requests(self):
@@ -65,7 +65,7 @@ class ListRequests:
def of_type(self, request_type):
results = config.db.store.find(
_Request,
- mailing_list=self.mailing_list, type=request_type)
+ mailing_list=self.mailing_list, request_type=request_type)
for request in results:
yield request
@@ -83,25 +83,12 @@ class ListRequests:
pendable.update(data)
token = config.db.pendings.add(pendable, timedelta(days=5000))
data_hash = token
- # XXX This would be a good other way to do it, but it causes the
- # select_by()'s in .count and .held_requests() to fail, even with
- # flush()'s.
-## result = _Request.table.insert().execute(
-## key=key, type=request_type,
-## mailing_list=self.mailing_list,
-## data_hash=data_hash)
-## row_id = result.last_inserted_ids()[0]
-## return row_id
- result = _Request(key=key, type=request_type,
- mailing_list=self.mailing_list,
- data_hash=data_hash)
- # XXX We need a handle on last_inserted_ids() instead of requiring a
- # flush of the database to get a valid id.
- config.db.flush()
- return result.id
+ request = _Request(key, request_type, self.mailing_list, data_hash)
+ config.db.store.add(request)
+ return request.id
def get_request(self, request_id):
- result = _Request.get(request_id)
+ result = config.db.store.get(_Request, request_id)
if result is None:
return None
if result.data_hash is None:
@@ -132,10 +119,16 @@ class Requests:
class _Request(Model):
"""Table for mailing list hold requests."""
- id = Int(primary=True)
+ id = Int(primary=True, default=AutoReload)
key = Unicode()
- type = Enum()
- data_hash = Unicode()
+ request_type = Enum()
+ data_hash = RawStr()
mailing_list_id = Int()
- mailing_list = Reference(mailing_list_id, 'MailingList')
+ mailing_list = Reference(mailing_list_id, 'MailingList.id')
+
+ def __init__(self, key, request_type, mailing_list, data_hash):
+ self.key = key
+ self.request_type = request_type
+ self.mailing_list = mailing_list
+ self.data_hash = data_hash
diff --git a/Mailman/docs/hold.txt b/Mailman/docs/hold.txt
index 9dae760d8..33c542d31 100644
--- a/Mailman/docs/hold.txt
+++ b/Mailman/docs/hold.txt
@@ -10,12 +10,12 @@ are held when they meet any of a number of criteria.
>>> from Mailman.Handlers.Hold import process
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
- >>> mlist.preferred_language = 'en'
- >>> mlist.real_name = '_XTest'
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
+ >>> mlist.preferred_language = u'en'
+ >>> mlist.real_name = u'_XTest'
>>> # XXX This will almost certainly change once we've worked out the web
>>> # space layout for mailing lists now.
- >>> mlist.web_page_url = 'http://lists.example.com/'
+ >>> mlist.web_page_url = u'http://lists.example.com/'
Here's a helper function used when we don't care about what's in the virgin
queue or in the pending database.
@@ -41,7 +41,6 @@ Short circuiting
If the message metadata indicates that the message is pre-approved, then the
handler returns immediately.
- >>> from email import message_from_string
>>> msg = message_from_string("""\
... From: aperson@example.com
...
@@ -109,7 +108,7 @@ Mailman will hold messages that have implicit destination, meaning that the
mailing list's posting address isn't included in the explicit recipients.
>>> mlist.require_explicit_destination = True
- >>> mlist.acceptable_aliases = ''
+ >>> mlist.acceptable_aliases = u''
>>> msg = message_from_string("""\
... From: aperson@example.org
... Subject: An implicit message
diff --git a/Mailman/docs/lifecycle.txt b/Mailman/docs/lifecycle.txt
index 1a3dfa2bf..ba9c83ef7 100644
--- a/Mailman/docs/lifecycle.txt
+++ b/Mailman/docs/lifecycle.txt
@@ -127,12 +127,12 @@ artifacts.
>>> from Mailman import Utils
>>> from Mailman.app.lifecycle import remove_list
>>> remove_list(mlist_2.fqdn_listname, mlist_2, True)
- >>> Utils.list_exists('test_2@example.com')
+ >>> Utils.list_exists(u'test_2@example.com')
False
We should now be able to completely recreate the mailing list.
- >>> mlist_2a = create_list('test_2@example.com', owners)
+ >>> mlist_2a = create_list(u'test_2@example.com', owners)
>>> sorted(addr.address for addr in mlist_2a.owners.addresses)
- ['aperson@example.com', 'bperson@example.com',
- 'cperson@example.com', 'dperson@example.com']
+ [u'aperson@example.com', u'bperson@example.com',
+ u'cperson@example.com', u'dperson@example.com']
diff --git a/Mailman/docs/listmanager.txt b/Mailman/docs/listmanager.txt
index 220be05e6..832100aca 100644
--- a/Mailman/docs/listmanager.txt
+++ b/Mailman/docs/listmanager.txt
@@ -19,7 +19,7 @@ Creating a mailing list
Creating the list returns the newly created IMailList object.
>>> from Mailman.interfaces import IMailingList
- >>> mlist = listmgr.create('_xtest@example.com')
+ >>> mlist = listmgr.create(u'_xtest@example.com')
>>> IMailingList.providedBy(mlist)
True
@@ -28,16 +28,16 @@ qualified listname. This latter is what uniquely distinguishes the mailing
list to the system.
>>> mlist.list_name
- '_xtest'
+ u'_xtest'
>>> mlist.host_name
- 'example.com'
+ u'example.com'
>>> mlist.fqdn_listname
- '_xtest@example.com'
+ u'_xtest@example.com'
If you try to create a mailing list with the same name as an existing list,
you will get an exception.
- >>> mlist_dup = listmgr.create('_xtest@example.com')
+ >>> mlist_dup = listmgr.create(u'_xtest@example.com')
Traceback (most recent call last):
...
MMListAlreadyExistsError: _xtest@example.com
@@ -54,9 +54,9 @@ Use the list manager to delete a mailing list.
After deleting the list, you can create it again.
- >>> mlist = listmgr.create('_xtest@example.com')
+ >>> mlist = listmgr.create(u'_xtest@example.com')
>>> mlist.fqdn_listname
- '_xtest@example.com'
+ u'_xtest@example.com'
Retrieving a mailing list
@@ -65,13 +65,13 @@ Retrieving a mailing list
When a mailing list exists, you can ask the list manager for it and you will
always get the same object back.
- >>> mlist_2 = listmgr.get('_xtest@example.com')
+ >>> mlist_2 = listmgr.get(u'_xtest@example.com')
>>> mlist_2 is mlist
True
If you try to get a list that doesn't existing yet, you get None.
- >>> print listmgr.get('_xtest_2@example.com')
+ >>> print listmgr.get(u'_xtest_2@example.com')
None
@@ -81,9 +81,9 @@ Iterating over all mailing lists
Once you've created a bunch of mailing lists, you can use the list manager to
iterate over either the list objects, or the list names.
- >>> mlist_3 = listmgr.create('_xtest_3@example.com')
- >>> mlist_4 = listmgr.create('_xtest_4@example.com')
+ >>> mlist_3 = listmgr.create(u'_xtest_3@example.com')
+ >>> mlist_4 = listmgr.create(u'_xtest_4@example.com')
>>> sorted(listmgr.names)
- ['_xtest@example.com', '_xtest_3@example.com', '_xtest_4@example.com']
+ [u'_xtest@example.com', u'_xtest_3@example.com', u'_xtest_4@example.com']
>>> sorted(m.fqdn_listname for m in listmgr.mailing_lists)
- ['_xtest@example.com', '_xtest_3@example.com', '_xtest_4@example.com']
+ [u'_xtest@example.com', u'_xtest_3@example.com', u'_xtest_4@example.com']
diff --git a/Mailman/docs/message.txt b/Mailman/docs/message.txt
index 4f0d08ce2..8f1e9c17c 100644
--- a/Mailman/docs/message.txt
+++ b/Mailman/docs/message.txt
@@ -13,7 +13,7 @@ instance, and then calls the .send() method on this object. This method
requires a mailing list instance.
>>> from Mailman.configuration import config
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
The UserNotification constructor takes the recipient address, the sender
diff --git a/Mailman/docs/messagestore.txt b/Mailman/docs/messagestore.txt
index 516ef257b..9b44a7e59 100644
--- a/Mailman/docs/messagestore.txt
+++ b/Mailman/docs/messagestore.txt
@@ -49,7 +49,7 @@ created above. Because Message-IDs are not guaranteed unique, looking up
messages with that key resturns a collection. The collection may be empty if
there are no matches.
- >>> list(store.get_messages_by_message_id('nothing'))
+ >>> list(store.get_messages_by_message_id(u'nothing'))
[]
Given an existing Message-ID, all matching messages will be found.
diff --git a/Mailman/docs/nntp.txt b/Mailman/docs/nntp.txt
index f8b837388..fefddd8b2 100644
--- a/Mailman/docs/nntp.txt
+++ b/Mailman/docs/nntp.txt
@@ -8,8 +8,8 @@ NNTP is to Usenet as IP is to the web, it's more general than that.
>>> from Mailman.Handlers.ToUsenet import process
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
- >>> mlist.preferred_language = 'en'
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
+ >>> mlist.preferred_language = u'en'
>>> switchboard = Switchboard(config.NEWSQUEUE_DIR)
Gatewaying from the mailing list to the newsgroup happens through a separate
@@ -21,7 +21,7 @@ There are several situations which prevent a message from being gatewayed to
the newsgroup. The feature could be disabled, as is the default.
>>> mlist.gateway_to_news = False
- >>> msg = message_from_string("""\
+ >>> msg = message_from_string(u"""\
... Subject: An important message
...
... Something of great import.
@@ -48,8 +48,8 @@ However, other posted messages get gated to the newsgroup via the nntp queue.
The list owner can set the linked newsgroup and the nntp host that its
messages are gated to.
- >>> mlist.linked_newsgroup = 'comp.lang.thing'
- >>> mlist.nntp_host = 'news.example.com'
+ >>> mlist.linked_newsgroup = u'comp.lang.thing'
+ >>> mlist.nntp_host = u'news.example.com'
>>> process(mlist, msg, {})
>>> len(switchboard.files)
1
@@ -63,6 +63,6 @@ messages are gated to.
<BLANKLINE>
>>> sorted(msgdata.items())
[('_parsemsg', False),
- ('listname', '_xtest@example.com'),
+ ('listname', u'_xtest@example.com'),
('received_time', ...),
('version', 3)]
diff --git a/Mailman/docs/outgoing.txt b/Mailman/docs/outgoing.txt
index 48bc287b8..ba2c6430b 100644
--- a/Mailman/docs/outgoing.txt
+++ b/Mailman/docs/outgoing.txt
@@ -12,7 +12,7 @@ headers for unambigous bounce processing.
>>> from Mailman.Handlers.ToOutgoing import process
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> switchboard = Switchboard(config.OUTQUEUE_DIR)
>>> def queue_size():
@@ -56,7 +56,7 @@ additional key set: the mailing list name.
>>> sorted(qmsgdata.items())
[('_parsemsg', False),
('bar', 2), ('foo', 1),
- ('listname', '_xtest@example.com'),
+ ('listname', u'_xtest@example.com'),
('received_time', ...),
('verp', True), ('version', 3)]
>>> queue_size()
@@ -66,9 +66,11 @@ If the list is set to personalize deliveries, and the global configuration
option to VERP personalized deliveries is set, then the message will be
VERP'd.
+ # Save the original value for clean up.
+ >>> verp_personalized_delivieries = config.VERP_PERSONALIZED_DELIVERIES
+ >>> config.VERP_PERSONALIZED_DELIVERIES = True
>>> from Mailman.interfaces import Personalization
>>> mlist.personalize = Personalization.individual
- >>> config.VERP_PERSONALIZED_DELIVERIES = True
>>> msgdata = dict(foo=1, bar=2)
>>> process(mlist, msg, msgdata)
>>> msgdata['verp']
@@ -92,8 +94,10 @@ the global configuration variable VERP_DELIVERY_INTERVAL. This variable tells
Mailman how often to VERP even non-personalized mailing lists. It can be set
to zero, which means non-personalized messages will never be VERP'd.
- >>> mlist.personalize = Personalization.none
+ # Save the original value for clean up.
+ >>> verp_delivery_interval = config.VERP_DELIVERY_INTERVAL
>>> config.VERP_DELIVERY_INTERVAL = 0
+ >>> mlist.personalize = Personalization.none
>>> msgdata = dict(foo=1, bar=2)
>>> process(mlist, msg, msgdata)
>>> print msgdata.get('verp')
@@ -142,3 +146,10 @@ will be VERP'd.
9 True
>>> queue_size()
10
+
+
+Clean up
+========
+
+ >>> config.VERP_PERSONALIZED_DELIVERIES = verp_personalized_delivieries
+ >>> config.VERP_DELIVERY_INTERVAL = verp_delivery_interval
diff --git a/Mailman/docs/requests.txt b/Mailman/docs/requests.txt
index febf3e430..3ef272c9e 100644
--- a/Mailman/docs/requests.txt
+++ b/Mailman/docs/requests.txt
@@ -14,7 +14,7 @@ Here is a helper function for printing out held requests.
... key, data = requests.get_request(request.id)
... if data is not None:
... data = sorted(data.items())
- ... print request.id, str(request.type), key, data
+ ... print request.id, str(request.request_type), key, data
And another helper for displaying messages in the virgin queue.
@@ -65,10 +65,10 @@ of associated data. The request database assigns no semantics to the held
data, except for the request type. Here we hold some simple bits of data.
>>> from Mailman.interfaces import RequestType
- >>> id_1 = requests.hold_request(RequestType.held_message, 'hold_1')
- >>> id_2 = requests.hold_request(RequestType.subscription, 'hold_2')
- >>> id_3 = requests.hold_request(RequestType.unsubscription, 'hold_3')
- >>> id_4 = requests.hold_request(RequestType.held_message, 'hold_4')
+ >>> id_1 = requests.hold_request(RequestType.held_message, u'hold_1')
+ >>> id_2 = requests.hold_request(RequestType.subscription, u'hold_2')
+ >>> id_3 = requests.hold_request(RequestType.unsubscription, u'hold_3')
+ >>> id_4 = requests.hold_request(RequestType.held_message, u'hold_4')
>>> id_1, id_2, id_3, id_4
(1, 2, 3, 4)
@@ -98,7 +98,7 @@ If we try to hold a request with a bogus type, we get an exception.
We can hold requests with additional data.
>>> data = dict(foo='yes', bar='no')
- >>> id_5 = requests.hold_request(RequestType.held_message, 'hold_5', data)
+ >>> id_5 = requests.hold_request(RequestType.held_message, u'hold_5', data)
>>> id_5
5
>>> requests.count
@@ -212,7 +212,6 @@ For this section, we need a mailing list and at least one message.
>>> mlist = config.db.list_manager.create('alist@example.com')
>>> mlist.preferred_language = 'en'
>>> mlist.real_name = 'A Test List'
- >>> from email import message_from_string
>>> msg = message_from_string(u"""\
... From: aperson@example.org
... To: alist@example.com
diff --git a/Mailman/docs/runner.txt b/Mailman/docs/runner.txt
index 4143c36a6..5e5a88d8c 100644
--- a/Mailman/docs/runner.txt
+++ b/Mailman/docs/runner.txt
@@ -64,8 +64,7 @@ on instance variables.
>>> sorted(runner.msgdata.items())
[('_parsemsg', False),
('bar', 'no'), ('foo', 'yes'),
- ('lang', 'en'), ('listname', '_xtest@example.com'),
+ ('lang', u'en'), ('listname', u'_xtest@example.com'),
('received_time', ...), ('version', 3)]
-
XXX More of the Runner API should be tested.
diff --git a/Mailman/docs/switchboard.txt b/Mailman/docs/switchboard.txt
index ce8f277ed..299aba499 100644
--- a/Mailman/docs/switchboard.txt
+++ b/Mailman/docs/switchboard.txt
@@ -4,21 +4,19 @@ The switchboard
The switchboard is subsystem that moves messages between queues. Each
instance of a switchboard is responsible for one queue directory.
- >>> from email import message_from_string
- >>> from Mailman.Message import Message
- >>> from Mailman.queue import Switchboard
- >>> msg = message_from_string("""\
+ >>> msg = message_from_string(u"""\
... From: aperson@example.com
... To: _xtest@example.com
...
... A test message.
- ... """, Message)
+ ... """)
Create a switchboard by giving its queue directory.
>>> import os
>>> from Mailman.configuration import config
>>> queue_directory = os.path.join(config.QUEUE_DIR, 'test')
+ >>> from Mailman.queue import Switchboard
>>> switchboard = Switchboard(queue_directory)
>>> switchboard.queue_directory == queue_directory
True