diff options
| author | Barry Warsaw | 2012-11-04 16:32:19 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2012-11-04 16:32:19 -0500 |
| commit | e56ca2098b727c762e2572b044fc8c943770b5b4 (patch) | |
| tree | 47bbecabb8c2d1165ffbc8cecfe043dc23b99f1c /src/mailman/testing/layers.py | |
| parent | 23fca2302ea2a8c5bad0a7aa450ea210ace7cf27 (diff) | |
| parent | 7caa62a470b4b4239aca136803ad04ad8193a175 (diff) | |
| download | mailman-e56ca2098b727c762e2572b044fc8c943770b5b4.tar.gz mailman-e56ca2098b727c762e2572b044fc8c943770b5b4.tar.zst mailman-e56ca2098b727c762e2572b044fc8c943770b5b4.zip | |
Merge Aurélien Bompard's branch to factor our archiver-specific configurations
into their own configuration files. Reworked by Barry to use the new external
configuration file support, and to make test suite succeed.
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/testing/layers.py')
| -rw-r--r-- | src/mailman/testing/layers.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py index 3a3e1f684..99450d143 100644 --- a/src/mailman/testing/layers.py +++ b/src/mailman/testing/layers.py @@ -114,14 +114,25 @@ class ConfigLayer(MockAndMonkeyLayer): # runners) we'll need a file that we can specify to the with the -C # option. Craft the full test configuration string here, push it, and # also write it out to a temp file for -C. + # + # Create a dummy postfix.cfg file so that the test suite doesn't try + # to run the actual postmap command, which may not exist anyway. + postfix_cfg = os.path.join(cls.var_dir, 'postfix.cfg') + with open(postfix_cfg, 'w') as fp: + print(dedent(""" + [postfix] + postmap_command: true + """), file=fp) test_config = dedent(""" [mailman] layout: testing [paths.testing] - var_dir: %s + var_dir: {0} [devmode] testing: yes - """ % cls.var_dir) + [mta] + configuration: {1} + """.format(cls.var_dir, postfix_cfg)) # Read the testing config and push it. test_config += resource_string('mailman.testing', 'testing.cfg') config.create_paths = True |
