summaryrefslogtreecommitdiff
path: root/src/mailman/mta/tests/test_aliases.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-11-04 15:49:08 -0500
committerBarry Warsaw2012-11-04 15:49:08 -0500
commit89f6e779db51478ea95b71f2ad3dc9d7f5f51e05 (patch)
treee1054919eb00e3abf73b4387277c4c79aca52b64 /src/mailman/mta/tests/test_aliases.py
parent23fca2302ea2a8c5bad0a7aa450ea210ace7cf27 (diff)
downloadmailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.tar.gz
mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.tar.zst
mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.zip
Diffstat (limited to 'src/mailman/mta/tests/test_aliases.py')
-rw-r--r--src/mailman/mta/tests/test_aliases.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/mailman/mta/tests/test_aliases.py b/src/mailman/mta/tests/test_aliases.py
index cc6b677b3..e22385dcf 100644
--- a/src/mailman/mta/tests/test_aliases.py
+++ b/src/mailman/mta/tests/test_aliases.py
@@ -37,7 +37,6 @@ from mailman.app.lifecycle import create_list
from mailman.interfaces.domain import IDomainManager
from mailman.interfaces.mta import IMailTransportAgentAliases
from mailman.mta.postfix import LMTP
-from mailman.testing.helpers import configuration
from mailman.testing.layers import ConfigLayer
@@ -145,14 +144,12 @@ class TestPostfix(unittest.TestCase):
self.utility = getUtility(IMailTransportAgentAliases)
self.mlist = create_list('test@example.com')
self.postfix = LMTP()
- # Python 2.7 has assertMultiLineEqual. Let this work without bounds.
+ # Let assertMultiLineEqual work without bounds.
self.maxDiff = None
- self.eq = getattr(self, 'assertMultiLineEqual', self.assertEqual)
def tearDown(self):
shutil.rmtree(self.tempdir)
- @configuration('mta', postfix_map_cmd='true')
def test_aliases(self):
# Test the format of the Postfix alias generator.
self.postfix.regenerate(self.tempdir)
@@ -163,13 +160,13 @@ class TestPostfix(unittest.TestCase):
# ignore the file header.
with open(os.path.join(self.tempdir, 'postfix_domains')) as fp:
contents = _strip_header(fp.read())
- self.eq(contents, """\
+ self.assertMultiLineEqual(contents, """\
example.com example.com
""")
# The lmtp file contains transport mappings to the lmtp server.
with open(os.path.join(self.tempdir, 'postfix_lmtp')) as fp:
contents = _strip_header(fp.read())
- self.eq(contents, """\
+ self.assertMultiLineEqual(contents, """\
# 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
@@ -182,7 +179,6 @@ test-subscribe@example.com lmtp:[127.0.0.1]:9024
test-unsubscribe@example.com lmtp:[127.0.0.1]:9024
""")
- @configuration('mta', postfix_map_cmd='true')
def test_two_lists(self):
# Both lists need to show up in the aliases file. LP: #874929.
# Create a second list.
@@ -195,13 +191,13 @@ test-unsubscribe@example.com lmtp:[127.0.0.1]:9024
# entry in the relays file.
with open(os.path.join(self.tempdir, 'postfix_domains')) as fp:
contents = _strip_header(fp.read())
- self.eq(contents, """\
+ self.assertMultiLineEqual(contents, """\
example.com example.com
""")
# The transport file contains entries for both lists.
with open(os.path.join(self.tempdir, 'postfix_lmtp')) as fp:
contents = _strip_header(fp.read())
- self.eq(contents, """\
+ self.assertMultiLineEqual(contents, """\
# 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
@@ -224,7 +220,6 @@ test-subscribe@example.com lmtp:[127.0.0.1]:9024
test-unsubscribe@example.com lmtp:[127.0.0.1]:9024
""")
- @configuration('mta', postfix_map_cmd='true')
def test_two_lists_two_domains(self):
# Now we have two lists in two different domains. Both lists will
# show up in the postfix_lmtp file, and both domains will show up in
@@ -239,14 +234,14 @@ test-unsubscribe@example.com lmtp:[127.0.0.1]:9024
# entry in the relays file.
with open(os.path.join(self.tempdir, 'postfix_domains')) as fp:
contents = _strip_header(fp.read())
- self.eq(contents, """\
+ self.assertMultiLineEqual(contents, """\
example.com example.com
example.net example.net
""")
# The transport file contains entries for both lists.
with open(os.path.join(self.tempdir, 'postfix_lmtp')) as fp:
contents = _strip_header(fp.read())
- self.eq(contents, """\
+ self.assertMultiLineEqual(contents, """\
# 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