diff options
| author | Barry Warsaw | 2015-04-06 21:39:34 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-04-06 21:39:34 -0400 |
| commit | a499404b568b303697b1969d8766f7f8433b76a7 (patch) | |
| tree | dc410aa3a1179d8509a58f2978a89943f3664d08 /src/mailman/rest/docs | |
| parent | 20edc89f208b201e34628cc021c5bfe36ef5a035 (diff) | |
| download | mailman-a499404b568b303697b1969d8766f7f8433b76a7.tar.gz mailman-a499404b568b303697b1969d8766f7f8433b76a7.tar.zst mailman-a499404b568b303697b1969d8766f7f8433b76a7.zip | |
Add lots of test for various bits of domain owners.
A little refactoring of list_of_str() into list_of_strings_validator() which
is now put in the validators.py module and used in several places.
Python 3 super() style.
Add some code and tests to catch <domain>/owners references when <domain>
doesn't exist.
Diffstat (limited to 'src/mailman/rest/docs')
| -rw-r--r-- | src/mailman/rest/docs/domains.rst | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/src/mailman/rest/docs/domains.rst b/src/mailman/rest/docs/domains.rst index f57dee572..34e3b9a18 100644 --- a/src/mailman/rest/docs/domains.rst +++ b/src/mailman/rest/docs/domains.rst @@ -224,17 +224,9 @@ you can add some domain owners. Currently our domain has no owners: Anne and Bart volunteer to be a domain owners. :: - >>> dump_json('http://localhost:9001/3.0/domains/my.example.com/owners', { - ... 'owner': 'anne@example.com', - ... }) - content-length: 0 - date: ... - server: ... - status: 204 - - >>> dump_json('http://localhost:9001/3.0/domains/my.example.com/owners', { - ... 'owner': 'bart@example.com', - ... }) + >>> dump_json('http://localhost:9001/3.0/domains/my.example.com/owners', ( + ... ('owner', 'anne@example.com'), ('owner', 'bart@example.com') + ... )) content-length: 0 date: ... server: ... @@ -261,8 +253,34 @@ We can delete all the domain owners. >>> dump_json('http://localhost:9001/3.0/domains/my.example.com/owners', ... method='DELETE') + content-length: 0 + date: ... + server: ... + status: 204 + +Now there are no owners. >>> dump_json('http://localhost:9001/3.0/domains/my.example.com/owners') + http_etag: ... + start: 0 + total_size: 0 + +New domains can be created with owners. + + >>> dump_json('http://localhost:9001/3.0/domains', ( + ... ('mail_host', 'your.example.com'), + ... ('owner', 'anne@example.com'), + ... ('owner', 'bart@example.com'), + ... )) + content-length: 0 + date: ... + location: http://localhost:9001/3.0/domains/your.example.com + server: ... + status: 201 + +The new domain has the expected owners. + + >>> dump_json('http://localhost:9001/3.0/domains/your.example.com/owners') entry 0: created_on: 2005-08-01T07:49:23 http_etag: ... |
