diff options
Diffstat (limited to 'src/mailman_pgp/rest/tests/test_lists.py')
| -rw-r--r-- | src/mailman_pgp/rest/tests/test_lists.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mailman_pgp/rest/tests/test_lists.py b/src/mailman_pgp/rest/tests/test_lists.py index 8e3ba31..5d7c6aa 100644 --- a/src/mailman_pgp/rest/tests/test_lists.py +++ b/src/mailman_pgp/rest/tests/test_lists.py @@ -21,6 +21,7 @@ from urllib.error import HTTPError from mailman.app.lifecycle import create_list from mailman.interfaces.action import Action +from mailman.interfaces.member import MemberRole from mailman.testing.helpers import call_api from pgpy import PGPKey @@ -170,6 +171,16 @@ class TestListConfig(TestCase): self.assertEqual(response.status_code, 204) self.assertEqual(self.pgp_list.unsigned_msg_action, Action.defer) + def test_patch_set(self): + json, response = call_api( + 'http://localhost:9001/3.1/plugins/pgp/lists/' + 'test.example.com', + data=dict(key_signing_allowed=['member', 'owner']), + method='PATCH') + self.assertEqual(response.status_code, 204) + self.assertEqual(self.pgp_list.key_signing_allowed, + {MemberRole.member, MemberRole.owner}) + def test_patch_wrong_attribute(self): with self.assertRaises(HTTPError) as cm: call_api('http://localhost:9001/3.1/plugins/pgp/lists/' |
