diff options
| author | Barry Warsaw | 2008-02-26 21:24:13 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2008-02-26 21:24:13 -0500 |
| commit | f0c044111dfdf6ffe3531df18ccf268a4056874b (patch) | |
| tree | d3145c9d06e8334ba51b896ed14626ef7400d9fc | |
| parent | 94bdb0a452dc088002f156e3e0e032085693d3f3 (diff) | |
| download | mailman-f0c044111dfdf6ffe3531df18ccf268a4056874b.tar.gz mailman-f0c044111dfdf6ffe3531df18ccf268a4056874b.tar.zst mailman-f0c044111dfdf6ffe3531df18ccf268a4056874b.zip | |
| -rw-r--r-- | Mailman/pipeline/docs/ack-headers.txt | 1 | ||||
| -rw-r--r-- | Mailman/pipeline/docs/acknowledge.txt | 1 | ||||
| -rw-r--r-- | Mailman/rules/docs/emergency.txt | 1 | ||||
| -rw-r--r-- | Mailman/tests/helpers.py | 9 | ||||
| -rw-r--r-- | Mailman/tests/test_documentation.py | 3 |
5 files changed, 10 insertions, 5 deletions
diff --git a/Mailman/pipeline/docs/ack-headers.txt b/Mailman/pipeline/docs/ack-headers.txt index 8926e6d91..bbede2020 100644 --- a/Mailman/pipeline/docs/ack-headers.txt +++ b/Mailman/pipeline/docs/ack-headers.txt @@ -7,6 +7,7 @@ transformations. Some headers get added, others get changed. Some of these changes depend on mailing list settings and others depend on how the message is getting sent through the system. We'll take things one-by-one. + >>> from Mailman.configuration import config >>> from Mailman.pipeline.cook_headers import process >>> mlist = config.db.list_manager.create(u'_xtest@example.com') >>> mlist.subject_prefix = u'' diff --git a/Mailman/pipeline/docs/acknowledge.txt b/Mailman/pipeline/docs/acknowledge.txt index 3dd92854f..86015d2c4 100644 --- a/Mailman/pipeline/docs/acknowledge.txt +++ b/Mailman/pipeline/docs/acknowledge.txt @@ -5,6 +5,7 @@ When a user posts a message to a mailing list, and that user has chosen to receive acknowledgments of their postings, Mailman will sent them such an acknowledgment. + >>> from Mailman.configuration import config >>> handler = config.handlers['acknowledge'] >>> mlist = config.db.list_manager.create(u'_xtest@example.com') >>> mlist.real_name = u'XTest' diff --git a/Mailman/rules/docs/emergency.txt b/Mailman/rules/docs/emergency.txt index aecbcb90d..05a9dcff2 100644 --- a/Mailman/rules/docs/emergency.txt +++ b/Mailman/rules/docs/emergency.txt @@ -27,6 +27,7 @@ There are two messages in the virgin queue. The one addressed to the original sender will contain a token we can use to grab the held message out of the pending requests. + >>> from Mailman.configuration import config >>> from Mailman.queue import Switchboard >>> virginq = Switchboard(config.VIRGINQUEUE_DIR) diff --git a/Mailman/tests/helpers.py b/Mailman/tests/helpers.py index 3f35b73dc..564c133d9 100644 --- a/Mailman/tests/helpers.py +++ b/Mailman/tests/helpers.py @@ -40,6 +40,9 @@ from Mailman.configuration import config from Mailman.queue import Switchboard +WAIT_INTERVAL = timedelta(seconds=3) + + def make_testable_runner(runner_class): """Create a queue runner that runs until its queue is empty. @@ -110,7 +113,7 @@ class Watcher: (self.exe, '-C', config.filename, '-q', 'start')) stdout, stderr = process.communicate() # Wait until the pid file exists. - until = datetime.now() + timedelta(seconds=2) + until = datetime.now() + WAIT_INTERVAL while datetime.now() < until: try: with open(config.PIDFILE) as f: @@ -125,7 +128,7 @@ class Watcher: # This will usually cause the doctest to fail. return 'Time out' # Now wait until the process actually exists. - until = datetime.now() + timedelta(seconds=2) + until = datetime.now() + WAIT_INTERVAL while datetime.now() < until: try: os.kill(pid, 0) @@ -148,7 +151,7 @@ class Watcher: (self.exe, '-C', config.filename, '-q', 'stop')) stdout, stderr = process.communicate() # Now wait until the process stops. - until = datetime.now() + timedelta(seconds=2) + until = datetime.now() + WAIT_INTERVAL while datetime.now() < until: try: os.kill(self.pid, 0) diff --git a/Mailman/tests/test_documentation.py b/Mailman/tests/test_documentation.py index d9a052d70..8cbdd5653 100644 --- a/Mailman/tests/test_documentation.py +++ b/Mailman/tests/test_documentation.py @@ -52,8 +52,7 @@ def specialized_message_from_string(text): def setup(testobj): - """Set up some things for convenience.""" - testobj.globs['config'] = config + """Test setup.""" testobj.globs['message_from_string'] = specialized_message_from_string |
