diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/commands/cli_info.py | 4 | ||||
| -rw-r--r-- | src/mailman/commands/docs/info.txt | 4 | ||||
| -rw-r--r-- | src/mailman/queue/docs/rest.txt | 4 | ||||
| -rw-r--r-- | src/mailman/rest/docs/basic.txt | 8 | ||||
| -rw-r--r-- | src/mailman/rest/docs/configuration.txt | 24 | ||||
| -rw-r--r-- | src/mailman/rest/docs/domains.txt | 36 | ||||
| -rw-r--r-- | src/mailman/rest/docs/helpers.txt | 2 | ||||
| -rw-r--r-- | src/mailman/rest/docs/lists.txt | 24 | ||||
| -rw-r--r-- | src/mailman/rest/docs/membership.txt | 86 | ||||
| -rw-r--r-- | src/mailman/testing/layers.py | 2 | ||||
| -rw-r--r-- | src/mailman/testing/testing.cfg | 4 |
11 files changed, 105 insertions, 93 deletions
diff --git a/src/mailman/commands/cli_info.py b/src/mailman/commands/cli_info.py index 1a4ea75b4..22adbd384 100644 --- a/src/mailman/commands/cli_info.py +++ b/src/mailman/commands/cli_info.py @@ -32,6 +32,7 @@ from zope.interface import implements from mailman.config import config from mailman.core.i18n import _ from mailman.interfaces.command import ICLISubCommand +from mailman.rest.helpers import path_to from mailman.version import MAILMAN_VERSION_FULL @@ -68,6 +69,9 @@ class Info: print >> output, 'Python', sys.version print >> output, 'config file:', config.filename print >> output, 'db url:', config.db.url + print >> output, 'REST root url:', path_to('/') + print >> output, 'REST credentials: {0}:{1}'.format( + config.webservice.admin_user, config.webservice.admin_pass) if args.verbose: print >> output, 'File system paths:' longest = 0 diff --git a/src/mailman/commands/docs/info.txt b/src/mailman/commands/docs/info.txt index 85af9325b..bccb78fda 100644 --- a/src/mailman/commands/docs/info.txt +++ b/src/mailman/commands/docs/info.txt @@ -20,6 +20,8 @@ script ``mailman info``. By default, the info is printed to standard output. ... config file: .../test.cfg db url: sqlite:.../mailman.db + REST root url: http://localhost:9001/3.0/ + REST credentials: restadmin:restpass By passing in the ``-o/--output`` option, you can print the info to a file. @@ -35,6 +37,8 @@ By passing in the ``-o/--output`` option, you can print the info to a file. ... config file: .../test.cfg db url: sqlite:.../mailman.db + REST root url: http://localhost:9001/3.0/ + REST credentials: restadmin:restpass You can also get more verbose information, which contains a list of the file system paths that Mailman is using. diff --git a/src/mailman/queue/docs/rest.txt b/src/mailman/queue/docs/rest.txt index a71915a49..9e8851eca 100644 --- a/src/mailman/queue/docs/rest.txt +++ b/src/mailman/queue/docs/rest.txt @@ -10,11 +10,11 @@ Mailman is controllable through an administrative `REST`_ HTTP server. The RESTful server can be used to access basic version information. - >>> dump_json('http://localhost:8001/3.0/system') + >>> dump_json('http://localhost:9001/3.0/system') http_etag: "..." mailman_version: GNU Mailman 3.0... (...) python_version: ... - self_link: http://localhost:8001/3.0/system + self_link: http://localhost:9001/3.0/system Clean up diff --git a/src/mailman/rest/docs/basic.txt b/src/mailman/rest/docs/basic.txt index 614b074ba..cf02fa4ec 100644 --- a/src/mailman/rest/docs/basic.txt +++ b/src/mailman/rest/docs/basic.txt @@ -20,11 +20,11 @@ The Mailman major and minor version numbers are in the URL. System information can be retrieved from the server. By default JSON is returned. - >>> dump_json('http://localhost:8001/3.0/system') + >>> dump_json('http://localhost:9001/3.0/system') http_etag: "..." mailman_version: GNU Mailman 3.0... (...) python_version: ... - self_link: http://localhost:8001/3.0/system + self_link: http://localhost:9001/3.0/system Non-existent links @@ -33,7 +33,7 @@ Non-existent links When you try to access a link that doesn't exist, you get the appropriate HTTP 404 Not Found error. - >>> dump_json('http://localhost:8001/3.0/does-not-exist') + >>> dump_json('http://localhost:9001/3.0/does-not-exist') Traceback (most recent call last): ... HTTPError: HTTP Error 404: 404 Not Found @@ -49,7 +49,7 @@ an appropriate HTTP 401 Unauthorized error. >>> from base64 import b64encode >>> auth = b64encode('baduser:badpass') - >>> url = 'http://localhost:8001/3.0/system' + >>> url = 'http://localhost:9001/3.0/system' >>> headers = { ... 'Content-Type': 'application/x-www-form-urlencode', ... 'Authorization': 'Basic ' + auth, diff --git a/src/mailman/rest/docs/configuration.txt b/src/mailman/rest/docs/configuration.txt index dce9c8a95..1cfab0b6e 100644 --- a/src/mailman/rest/docs/configuration.txt +++ b/src/mailman/rest/docs/configuration.txt @@ -13,7 +13,7 @@ Reading a configuration All readable attributes for a list are available on a sub-resource. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config') acceptable_aliases: [] admin_immed_notify: True @@ -66,7 +66,7 @@ Not all of the readable attributes can be set through the web interface. The ones that can, can either be set via ``PUT`` or ``PATCH``. ``PUT`` changes all the writable attributes in one request. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict( ... acceptable_aliases=['one@example.com', 'two@example.com'], @@ -100,7 +100,7 @@ all the writable attributes in one request. These values are changed permanently. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config') acceptable_aliases: [u'one@example.com', u'two@example.com'] admin_immed_notify: False @@ -135,7 +135,7 @@ These values are changed permanently. If you use ``PUT`` to change a list's configuration, all writable attributes must be included. It is an error to leave one or more out... - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict( ... #acceptable_aliases=['one', 'two'], @@ -168,7 +168,7 @@ must be included. It is an error to leave one or more out... ...or to add an unknown one. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict( ... a_mailing_list_attribute=False, @@ -202,7 +202,7 @@ must be included. It is an error to leave one or more out... It is also an error to spell an attribute value incorrectly... - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict( ... admin_immed_notify='Nope', @@ -235,7 +235,7 @@ It is also an error to spell an attribute value incorrectly... ...or to name a pipeline that doesn't exist... - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict( ... acceptable_aliases=['one', 'two'], @@ -267,7 +267,7 @@ It is also an error to spell an attribute value incorrectly... ...or to name an invalid auto-response enumeration value. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict( ... acceptable_aliases=['one', 'two'], @@ -303,7 +303,7 @@ Changing a partial configuration Using ``PATCH``, you can change just one attribute. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config', ... dict(real_name='My List'), ... 'PATCH') @@ -337,7 +337,7 @@ emails. By default, a mailing list has no acceptable aliases. >>> from mailman.interfaces.mailinglist import IAcceptableAliasSet >>> IAcceptableAliasSet(mlist).clear() >>> transaction.commit() - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config/acceptable_aliases') acceptable_aliases: [] http_etag: "..." @@ -345,7 +345,7 @@ emails. By default, a mailing list has no acceptable aliases. We can add a few by ``PUT``-ing them on the sub-resource. The keys in the dictionary are ignored. - >>> dump_json('http://localhost:8001/3.0/lists/' + >>> dump_json('http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config/acceptable_aliases', ... dict(acceptable_aliases=['foo@example.com', ... 'bar@example.net']), @@ -358,7 +358,7 @@ dictionary are ignored. Aliases are returned as a list on the ``aliases`` key. >>> response = call_http( - ... 'http://localhost:8001/3.0/lists/' + ... 'http://localhost:9001/3.0/lists/' ... 'test-one@example.com/config/acceptable_aliases') >>> for alias in response['acceptable_aliases']: ... print alias diff --git a/src/mailman/rest/docs/domains.txt b/src/mailman/rest/docs/domains.txt index b9b7dc3d6..29592fadb 100644 --- a/src/mailman/rest/docs/domains.txt +++ b/src/mailman/rest/docs/domains.txt @@ -18,7 +18,7 @@ Domains The REST API can be queried for the set of known domains, of which there are initially none. - >>> dump_json('http://localhost:8001/3.0/domains') + >>> dump_json('http://localhost:9001/3.0/domains') http_etag: "..." start: 0 total_size: 0 @@ -33,14 +33,14 @@ Once a domain is added, it is accessible through the API. contact_address: postmaster@example.com> >>> transaction.commit() - >>> dump_json('http://localhost:8001/3.0/domains') + >>> dump_json('http://localhost:9001/3.0/domains') entry 0: base_url: http://lists.example.com contact_address: postmaster@example.com description: An example domain email_host: example.com http_etag: "..." - self_link: http://localhost:8001/3.0/domains/example.com + self_link: http://localhost:9001/3.0/domains/example.com url_host: lists.example.com http_etag: "..." start: 0 @@ -65,14 +65,14 @@ At the top level, all domains are returned as separate entries. contact_address: porkmaster@example.net> >>> transaction.commit() - >>> dump_json('http://localhost:8001/3.0/domains') + >>> dump_json('http://localhost:9001/3.0/domains') entry 0: base_url: http://lists.example.com contact_address: postmaster@example.com description: An example domain email_host: example.com http_etag: "..." - self_link: http://localhost:8001/3.0/domains/example.com + self_link: http://localhost:9001/3.0/domains/example.com url_host: lists.example.com entry 1: base_url: http://mail.example.org @@ -80,7 +80,7 @@ At the top level, all domains are returned as separate entries. description: None email_host: example.org http_etag: "..." - self_link: http://localhost:8001/3.0/domains/example.org + self_link: http://localhost:9001/3.0/domains/example.org url_host: mail.example.org entry 2: base_url: http://example.net @@ -88,7 +88,7 @@ At the top level, all domains are returned as separate entries. description: Porkmasters email_host: lists.example.net http_etag: "..." - self_link: http://localhost:8001/3.0/domains/lists.example.net + self_link: http://localhost:9001/3.0/domains/lists.example.net url_host: example.net http_etag: "..." start: 0 @@ -101,18 +101,18 @@ Individual domains The information for a single domain is available by following one of the ``self_links`` from the above collection. - >>> dump_json('http://localhost:8001/3.0/domains/lists.example.net') + >>> dump_json('http://localhost:9001/3.0/domains/lists.example.net') base_url: http://example.net contact_address: porkmaster@example.net description: Porkmasters email_host: lists.example.net http_etag: "..." - self_link: http://localhost:8001/3.0/domains/lists.example.net + self_link: http://localhost:9001/3.0/domains/lists.example.net url_host: example.net But we get a 404 for a non-existent domain. - >>> dump_json('http://localhost:8001/3.0/domains/does-not-exist') + >>> dump_json('http://localhost:9001/3.0/domains/does-not-exist') Traceback (most recent call last): ... HTTPError: HTTP Error 404: 404 Not Found @@ -123,23 +123,23 @@ Creating new domains New domains can be created by posting to the ``domains`` url. - >>> dump_json('http://localhost:8001/3.0/domains', { + >>> dump_json('http://localhost:9001/3.0/domains', { ... 'email_host': 'lists.example.com', ... }) content-length: 0 date: ... - location: http://localhost:8001/3.0/domains/lists.example.com + location: http://localhost:9001/3.0/domains/lists.example.com ... Now the web service knows about our new domain. - >>> dump_json('http://localhost:8001/3.0/domains/lists.example.com') + >>> dump_json('http://localhost:9001/3.0/domains/lists.example.com') base_url: http://lists.example.com contact_address: postmaster@lists.example.com description: None email_host: lists.example.com http_etag: "..." - self_link: http://localhost:8001/3.0/domains/lists.example.com + self_link: http://localhost:9001/3.0/domains/lists.example.com url_host: lists.example.com And the new domain is in our database. @@ -157,7 +157,7 @@ You can also create a new domain with a description, a base url, and a contact address. :: - >>> dump_json('http://localhost:8001/3.0/domains', { + >>> dump_json('http://localhost:9001/3.0/domains', { ... 'email_host': 'my.example.com', ... 'description': 'My new domain', ... 'base_url': 'http://allmy.example.com', @@ -165,16 +165,16 @@ address. ... }) content-length: 0 date: ... - location: http://localhost:8001/3.0/domains/my.example.com + location: http://localhost:9001/3.0/domains/my.example.com ... - >>> dump_json('http://localhost:8001/3.0/domains/my.example.com') + >>> dump_json('http://localhost:9001/3.0/domains/my.example.com') base_url: http://allmy.example.com contact_address: helpme@example.com description: My new domain email_host: my.example.com http_etag: "..." - self_link: http://localhost:8001/3.0/domains/my.example.com + self_link: http://localhost:9001/3.0/domains/my.example.com url_host: allmy.example.com >>> domain_manager['my.example.com'] diff --git a/src/mailman/rest/docs/helpers.txt b/src/mailman/rest/docs/helpers.txt index eec72da84..4f0b1c804 100644 --- a/src/mailman/rest/docs/helpers.txt +++ b/src/mailman/rest/docs/helpers.txt @@ -14,7 +14,7 @@ function can return them the full path to the resource. >>> from mailman.rest.helpers import path_to >>> print path_to('system') - http://localhost:8001/3.0/system + http://localhost:9001/3.0/system Parameters like the ``scheme``, ``host``, ``port``, and API version number can be set in the configuration file. diff --git a/src/mailman/rest/docs/lists.txt b/src/mailman/rest/docs/lists.txt index 4cb00e378..32cca5fb7 100644 --- a/src/mailman/rest/docs/lists.txt +++ b/src/mailman/rest/docs/lists.txt @@ -6,7 +6,7 @@ The REST API can be queried for the set of known mailing lists. There is a top level collection that can return all the mailing lists. There aren't any yet though. - >>> dump_json('http://localhost:8001/3.0/lists') + >>> dump_json('http://localhost:9001/3.0/lists') http_etag: "..." start: 0 total_size: 0 @@ -18,14 +18,14 @@ Create a mailing list in a domain and it's accessible via the API. <mailing list "test-one@example.com" at ...> >>> transaction.commit() - >>> dump_json('http://localhost:8001/3.0/lists') + >>> dump_json('http://localhost:9001/3.0/lists') entry 0: fqdn_listname: test-one@example.com host_name: example.com http_etag: "..." list_name: test-one real_name: Test-one - self_link: http://localhost:8001/3.0/lists/test-one@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com http_etag: "..." start: 0 total_size: 1 @@ -37,12 +37,12 @@ Creating lists via the API New mailing lists can also be created through the API, by posting to the ``lists`` URL. - >>> dump_json('http://localhost:8001/3.0/lists', { + >>> dump_json('http://localhost:9001/3.0/lists', { ... 'fqdn_listname': 'test-two@example.com', ... }) content-length: 0 date: ... - location: http://localhost:8001/3.0/lists/test-two@example.com + location: http://localhost:9001/3.0/lists/test-two@example.com ... The mailing list exists in the database. @@ -61,18 +61,18 @@ The mailing list exists in the database. It is also available via the location given in the response. - >>> dump_json('http://localhost:8001/3.0/lists/test-two@example.com') + >>> dump_json('http://localhost:9001/3.0/lists/test-two@example.com') fqdn_listname: test-two@example.com host_name: example.com http_etag: "..." list_name: test-two real_name: Test-two - self_link: http://localhost:8001/3.0/lists/test-two@example.com + self_link: http://localhost:9001/3.0/lists/test-two@example.com However, you are not allowed to create a mailing list in a domain that does not exist. - >>> dump_json('http://localhost:8001/3.0/lists', { + >>> dump_json('http://localhost:9001/3.0/lists', { ... 'fqdn_listname': 'test-three@example.org', ... }) Traceback (most recent call last): @@ -81,7 +81,7 @@ not exist. Nor can you create a mailing list that already exists. - >>> dump_json('http://localhost:8001/3.0/lists', { + >>> dump_json('http://localhost:9001/3.0/lists', { ... 'fqdn_listname': 'test-one@example.com', ... }) Traceback (most recent call last): @@ -96,7 +96,7 @@ Existing mailing lists can be deleted through the API, by doing an HTTP ``DELETE`` on the mailing list URL. :: - >>> dump_json('http://localhost:8001/3.0/lists/test-two@example.com', + >>> dump_json('http://localhost:9001/3.0/lists/test-two@example.com', ... method='DELETE') content-length: 0 date: ... @@ -116,13 +116,13 @@ You cannot delete a mailing list that does not exist or has already been deleted. :: - >>> dump_json('http://localhost:8001/3.0/lists/test-two@example.com', + >>> dump_json('http://localhost:9001/3.0/lists/test-two@example.com', ... method='DELETE') Traceback (most recent call last): ... HTTPError: HTTP Error 404: 404 Not Found - >>> dump_json('http://localhost:8001/3.0/lists/test-ten@example.com', + >>> dump_json('http://localhost:9001/3.0/lists/test-ten@example.com', ... method='DELETE') Traceback (most recent call last): ... diff --git a/src/mailman/rest/docs/membership.txt b/src/mailman/rest/docs/membership.txt index d34794447..f9a2d4dd4 100644 --- a/src/mailman/rest/docs/membership.txt +++ b/src/mailman/rest/docs/membership.txt @@ -8,7 +8,7 @@ returns all the members of all known mailing lists. There are no mailing lists and no members yet. - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') http_etag: "..." start: 0 total_size: 0 @@ -19,7 +19,7 @@ We create a mailing list, which starts out with no members. >>> mlist_one = create_list('test-one@example.com') >>> transaction.commit() - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') http_etag: "..." start: 0 total_size: 0 @@ -39,10 +39,10 @@ the REST interface. >>> from mailman.testing.helpers import subscribe >>> subscribe(mlist_one, 'Bart') - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') entry 0: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/bperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/bperson@example.com http_etag: "..." start: 0 total_size: 1 @@ -51,13 +51,13 @@ When Cris also joins the mailing list, her subscription is also available via the REST interface. >>> subscribe(mlist_one, 'Cris') - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') entry 0: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/bperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/bperson@example.com entry 1: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/cperson@example.com http_etag: "..." start: 0 total_size: 2 @@ -68,16 +68,16 @@ subscribes, she is returned first. >>> subscribe(mlist_one, 'Anna') - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') entry 0: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/aperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/aperson@example.com entry 1: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/bperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/bperson@example.com entry 2: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/cperson@example.com http_etag: "..." start: 0 total_size: 3 @@ -90,22 +90,22 @@ address. Anna and Cris subscribe to this new mailing list. >>> subscribe(mlist_two, 'Anna') >>> subscribe(mlist_two, 'Cris') - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') entry 0: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/aperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/aperson@example.com entry 1: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/cperson@example.com entry 2: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/aperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/aperson@example.com entry 3: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/bperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/bperson@example.com entry 4: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/cperson@example.com http_etag: "..." start: 0 total_size: 5 @@ -113,13 +113,13 @@ address. Anna and Cris subscribe to this new mailing list. We can also get just the members of a single mailing list. >>> dump_json( - ... 'http://localhost:8001/3.0/lists/alpha@example.com/roster/members') + ... 'http://localhost:9001/3.0/lists/alpha@example.com/roster/members') entry 0: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/aperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/aperson@example.com entry 1: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/cperson@example.com http_etag: ... start: 0 total_size: 2 @@ -136,28 +136,28 @@ test-one mailing list. >>> subscribe(mlist_one, 'Cris', MemberRole.owner) >>> subscribe(mlist_two, 'Dave', MemberRole.moderator) - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') entry 0: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/moderator/dperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/moderator/dperson@example.com entry 1: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/aperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/aperson@example.com entry 2: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/cperson@example.com entry 3: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/owner/cperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/owner/cperson@example.com entry 4: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/aperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/aperson@example.com entry 5: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/bperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/bperson@example.com entry 6: http_etag: ... - self_link: http://localhost:8001/3.0/lists/test-one@example.com/member/cperson@example.com + self_link: http://localhost:9001/3.0/lists/test-one@example.com/member/cperson@example.com http_etag: "..." start: 0 total_size: 7 @@ -174,14 +174,14 @@ Elly subscribes to the alpha mailing list. By default, get gets a regular delivery. Since Elly's email address is not yet known to Mailman, a user is created for her. - >>> dump_json('http://localhost:8001/3.0/members', { + >>> dump_json('http://localhost:9001/3.0/members', { ... 'fqdn_listname': 'alpha@example.com', ... 'address': 'eperson@example.com', ... 'real_name': 'Elly Person', ... }) content-length: 0 date: ... - location: http://localhost:8001/3.0/lists/alpha@example.com/member/eperson@example.com + location: http://localhost:9001/3.0/lists/alpha@example.com/member/eperson@example.com ... Elly is now a member of the mailing list. @@ -194,12 +194,12 @@ Elly is now a member of the mailing list. >>> set(member.mailing_list for member in elly.memberships.members) set([u'alpha@example.com']) - >>> dump_json('http://localhost:8001/3.0/members') + >>> dump_json('http://localhost:9001/3.0/members') entry 0: ... entry 3: http_etag: ... - self_link: http://localhost:8001/3.0/lists/alpha@example.com/member/eperson@example.com + self_link: http://localhost:9001/3.0/lists/alpha@example.com/member/eperson@example.com ... @@ -212,7 +212,7 @@ so she leaves from the mailing list. # Ensure our previous reads don't keep the database lock. >>> transaction.abort() - >>> dump_json('http://localhost:8001/3.0/lists/alpha@example.com' + >>> dump_json('http://localhost:9001/3.0/lists/alpha@example.com' ... '/member/eperson@example.com', ... method='DELETE') content-length: 0 @@ -232,7 +232,7 @@ Fred joins the alpha mailing list but wants MIME digest delivery. :: >>> transaction.abort() - >>> dump_json('http://localhost:8001/3.0/members', { + >>> dump_json('http://localhost:9001/3.0/members', { ... 'fqdn_listname': 'alpha@example.com', ... 'address': 'fperson@example.com', ... 'real_name': 'Fred Person', @@ -240,7 +240,7 @@ Fred joins the alpha mailing list but wants MIME digest delivery. ... }) content-length: 0 ... - location: http://localhost:8001/3.0/lists/alpha@example.com/member/fperson@example.com + location: http://localhost:9001/3.0/lists/alpha@example.com/member/fperson@example.com ... status: 201 @@ -258,7 +258,7 @@ Corner cases For some reason Elly tries to join a mailing list that does not exist. - >>> dump_json('http://localhost:8001/3.0/members', { + >>> dump_json('http://localhost:9001/3.0/members', { ... 'fqdn_listname': 'beta@example.com', ... 'address': 'eperson@example.com', ... 'real_name': 'Elly Person', @@ -269,7 +269,7 @@ For some reason Elly tries to join a mailing list that does not exist. Then, she tries to leave a mailing list that does not exist. - >>> dump_json('http://localhost:8001/3.0/lists/beta@example.com' + >>> dump_json('http://localhost:9001/3.0/lists/beta@example.com' ... '/members/eperson@example.com', ... method='DELETE') Traceback (most recent call last): @@ -278,7 +278,7 @@ Then, she tries to leave a mailing list that does not exist. She then tries to leave a mailing list with a bogus address. - >>> dump_json('http://localhost:8001/3.0/lists/alpha@example.com' + >>> dump_json('http://localhost:9001/3.0/lists/alpha@example.com' ... '/members/elly', ... method='DELETE') Traceback (most recent call last): @@ -288,7 +288,7 @@ She then tries to leave a mailing list with a bogus address. For some reason, Elly tries to leave the mailing list again, but she's already been unsubscribed. - >>> dump_json('http://localhost:8001/3.0/lists/alpha@example.com' + >>> dump_json('http://localhost:9001/3.0/lists/alpha@example.com' ... '/members/eperson@example.com', ... method='DELETE') Traceback (most recent call last): @@ -297,7 +297,7 @@ been unsubscribed. Anna tries to join a mailing list she's already a member of. - >>> dump_json('http://localhost:8001/3.0/members', { + >>> dump_json('http://localhost:9001/3.0/members', { ... 'fqdn_listname': 'alpha@example.com', ... 'address': 'aperson@example.com', ... }) @@ -307,7 +307,7 @@ Anna tries to join a mailing list she's already a member of. Gwen tries to join the alpha mailing list using an invalid delivery mode. - >>> dump_json('http://localhost:8001/3.0/members', { + >>> dump_json('http://localhost:9001/3.0/members', { ... 'fqdn_listname': 'alpha@example.com', ... 'address': 'gperson@example.com', ... 'real_name': 'Gwen Person', @@ -320,12 +320,12 @@ Gwen tries to join the alpha mailing list using an invalid delivery mode. Even using an address with "funny" characters Hugh can join the mailing list. >>> transaction.abort() - >>> dump_json('http://localhost:8001/3.0/members', { + >>> dump_json('http://localhost:9001/3.0/members', { ... 'fqdn_listname': 'alpha@example.com', ... 'address': 'hugh/person@example.com', ... 'real_name': 'Hugh Person', ... }) content-length: 0 date: ... - location: http://localhost:8001/3.0/lists/alpha@example.com/member/hugh%2Fperson@example.com + location: http://localhost:9001/3.0/lists/alpha@example.com/member/hugh%2Fperson@example.com ... diff --git a/src/mailman/testing/layers.py b/src/mailman/testing/layers.py index fbb2dfa8a..b26c93830 100644 --- a/src/mailman/testing/layers.py +++ b/src/mailman/testing/layers.py @@ -273,7 +273,7 @@ class RESTLayer(SMTPLayer): until = datetime.datetime.now() + TEST_TIMEOUT while datetime.datetime.now() < until: try: - request = Request('http://localhost:8001/3.0/system') + request = Request('http://localhost:9001/3.0/system') basic_auth = '{0}:{1}'.format(config.webservice.admin_user, config.webservice.admin_pass) request.add_header('Authorization', diff --git a/src/mailman/testing/testing.cfg b/src/mailman/testing/testing.cfg index 8c56d2135..e3f642d71 100644 --- a/src/mailman/testing/testing.cfg +++ b/src/mailman/testing/testing.cfg @@ -19,8 +19,12 @@ [mta] smtp_port: 9025 +lmtp_port: 9024 incoming: mailman.testing.mta.FakeMTA +[webservice] +port: 9001 + [qrunner.archive] max_restarts: 1 |
