summaryrefslogtreecommitdiff
path: root/src/mailman/mta/tests/test_aliases.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-06 11:57:17 -0500
committerBarry Warsaw2012-03-06 11:57:17 -0500
commit4ca5055eea7c521e620de8ceeff6fa538b7a0c0b (patch)
tree63f24624049b82974c9302f4663ae1d4d2cd1146 /src/mailman/mta/tests/test_aliases.py
parente2526bfa5cb3338ac98f101f3020b54c002252dc (diff)
downloadmailman-4ca5055eea7c521e620de8ceeff6fa538b7a0c0b.tar.gz
mailman-4ca5055eea7c521e620de8ceeff6fa538b7a0c0b.tar.zst
mailman-4ca5055eea7c521e620de8ceeff6fa538b7a0c0b.zip
Diffstat (limited to 'src/mailman/mta/tests/test_aliases.py')
-rw-r--r--src/mailman/mta/tests/test_aliases.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mailman/mta/tests/test_aliases.py b/src/mailman/mta/tests/test_aliases.py
index bf77298e6..b1a60bc95 100644
--- a/src/mailman/mta/tests/test_aliases.py
+++ b/src/mailman/mta/tests/test_aliases.py
@@ -127,26 +127,23 @@ class TestPostfix(unittest.TestCase):
"""Test the Postfix LMTP alias generator."""
layer = ConfigLayer
- # For Python 2.7's assertMultiLineEqual
- maxDiff = None
def setUp(self):
self.utility = getUtility(IMailTransportAgentAliases)
self.mlist = create_list('test@example.com')
self.output = StringIO()
self.postfix = LMTP()
- # For Python 2.7's unittest.
+ # Python 2.7 has assertMultiLineEqual. Let this work without bounds.
self.maxDiff = None
+ self.eq = getattr(self, 'assertMultiLineEqual', self.assertEqual)
def test_aliases(self):
# Test the format of the Postfix alias generator.
self.postfix.regenerate(self.output)
- # Python 2.7 has assertMultiLineEqual but Python 2.6 does not.
- eq = getattr(self, 'assertMultiLineEqual', self.assertEqual)
# Strip out the variable and unimportant bits of the output.
lines = self.output.getvalue().splitlines()
output = NL.join(lines[7:])
- eq(output, """\
+ self.eq(output, """\
# Aliases which are visible only in the @example.com domain.
test@example.com lmtp:[127.0.0.1]:9024
test-bounces@example.com lmtp:[127.0.0.1]:9024
@@ -163,13 +160,11 @@ test-unsubscribe@example.com lmtp:[127.0.0.1]:9024
# Both lists need to show up in the aliases file. LP: #874929.
# Create a second list.
create_list('other@example.com')
- # Python 2.7 has assertMultiLineEqual but Python 2.6 does not.
- eq = getattr(self, 'assertMultiLineEqual', self.assertEqual)
self.postfix.regenerate(self.output)
# Strip out the variable and unimportant bits of the output.
lines = self.output.getvalue().splitlines()
output = NL.join(lines[7:])
- eq(output, """\
+ self.eq(output, """\
# Aliases which are visible only in the @example.com domain.
other@example.com lmtp:[127.0.0.1]:9024
other-bounces@example.com lmtp:[127.0.0.1]:9024