diff options
| author | Barry Warsaw | 2012-11-04 15:49:08 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2012-11-04 15:49:08 -0500 |
| commit | 89f6e779db51478ea95b71f2ad3dc9d7f5f51e05 (patch) | |
| tree | e1054919eb00e3abf73b4387277c4c79aca52b64 /src/mailman/mta/tests | |
| parent | 23fca2302ea2a8c5bad0a7aa450ea210ace7cf27 (diff) | |
| download | mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.tar.gz mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.tar.zst mailman-89f6e779db51478ea95b71f2ad3dc9d7f5f51e05.zip | |
Configuration
-------------
* `[passlib]path` configuration variable renamed to `[passlib]configuration`.
* Postfix-specific configurations in the `[mta]` section are moved to a
separate file, named by the `[mta]configuration` variable.
* In the new `postfix.cfg` file, `postfix_map_cmd` is renamed to
`postmap_command`.
Also:
* More Python 2.7-isms, use assertMultiLineEqual() directly.
* Added external_configuration() and load_external() to mailman.config.config
* ConfigLayer does a blanket set of [postfix]postmap_command so subtests
generally won't have to.
Diffstat (limited to 'src/mailman/mta/tests')
| -rw-r--r-- | src/mailman/mta/tests/test_aliases.py | 19 | ||||
| -rw-r--r-- | src/mailman/mta/tests/test_delivery.py | 5 |
2 files changed, 9 insertions, 15 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 diff --git a/src/mailman/mta/tests/test_delivery.py b/src/mailman/mta/tests/test_delivery.py index fbac0d121..c56058832 100644 --- a/src/mailman/mta/tests/test_delivery.py +++ b/src/mailman/mta/tests/test_delivery.py @@ -95,9 +95,8 @@ options : $user_optionsurl template_dir: {0} """.format(self._template_dir)) self._mlist.footer_uri = 'mailman:///member-footer.txt' - # 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): # Free references. @@ -124,7 +123,7 @@ options : $user_optionsurl self.assertEqual(len(refused), 0) self.assertEqual(len(_deliveries), 1) _mlist, _msg, _msgdata, _recipients = _deliveries[0] - self.eq(_msg.as_string(), """\ + self.assertMultiLineEqual(_msg.as_string(), """\ From: anne@example.org To: test@example.com Subject: test |
