diff options
| author | Barry Warsaw | 2012-03-22 18:29:58 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-03-22 18:29:58 -0400 |
| commit | aa2d0ad067adfd2515ed3c256cd0bca296058479 (patch) | |
| tree | 5aac48ec333bb6c6d69fe53b319e7b53f24483e2 /src/mailman/runners/tests/test_join.py | |
| parent | ae15984804096db593d83740dcd4c158626eb22f (diff) | |
| download | mailman-aa2d0ad067adfd2515ed3c256cd0bca296058479.tar.gz mailman-aa2d0ad067adfd2515ed3c256cd0bca296058479.tar.zst mailman-aa2d0ad067adfd2515ed3c256cd0bca296058479.zip | |
Several fixes and cleanups, ostensibly to fix Python 2.6 support.
- email.iterators.body_line_iterator() cannot handle unicodes in Python 2.6,
because it uses cStringIO.StringIO under the covers, and *that* can't handle
unicode. This works fine in Python 2.7, so I override this for the tests
only under 2.6 (the code itself isn't affected).
- AddressError needs to str() its IAddress attribute explicitly in the
__str__() method, otherwise under Python 2.6, you'll get unprintable reprs
in the doctests. Again, this works correctly in 2.7, but EIBTI, so it can't
hurt either way.
- EmailError: a new exception, not related to AddressError. The reason for
this it to conform to current nomenclature: "address" means an IAddress
while "email" means a text email address. So InvalidEmailAddressError
now derives from EmailError instead of AddressError because it gets passed a
text email address, and because that is invalid, it never gets turned into
an IAddress. The __str__() of this new base exception class does some
tricky encoding to keep it compatible between Python 2.6 and 2.7.
- UnverifiedAddressError derives from AddressError instead of the more generic
MailmanError.
- A few random code cleanups are included.
Diffstat (limited to 'src/mailman/runners/tests/test_join.py')
| -rw-r--r-- | src/mailman/runners/tests/test_join.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mailman/runners/tests/test_join.py b/src/mailman/runners/tests/test_join.py index 8cbd8659f..a584fd2c2 100644 --- a/src/mailman/runners/tests/test_join.py +++ b/src/mailman/runners/tests/test_join.py @@ -21,12 +21,13 @@ from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ + 'TestJoin', + 'TestJoinWithDigests', ] import unittest -from email.iterators import body_line_iterator from zope.component import getUtility from mailman.app.lifecycle import create_list @@ -37,6 +38,7 @@ from mailman.interfaces.subscriptions import ISubscriptionService from mailman.interfaces.usermanager import IUserManager from mailman.runners.command import CommandRunner from mailman.testing.helpers import ( + body_line_iterator, get_queue_messages, make_testable_runner, reset_the_world, |
