aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-08-10 20:55:51 +0200
committerJ08nY2017-08-10 20:57:17 +0200
commiteefc09382e62303871773063fc285ce39d118bb9 (patch)
tree1a976fc9ea32ca770b496b43eaffeb170b9f5d29
parentfc2ef7bf00a540b335ed6d75e7684e717774bfcf (diff)
downloadmailman-pgp-eefc09382e62303871773063fc285ce39d118bb9.tar.gz
mailman-pgp-eefc09382e62303871773063fc285ce39d118bb9.tar.zst
mailman-pgp-eefc09382e62303871773063fc285ce39d118bb9.zip
-rw-r--r--src/mailman_pgp/rest/lists.py10
-rw-r--r--src/mailman_pgp/rest/tests/test_lists.py9
2 files changed, 8 insertions, 11 deletions
diff --git a/src/mailman_pgp/rest/lists.py b/src/mailman_pgp/rest/lists.py
index b8175d2..fbece1d 100644
--- a/src/mailman_pgp/rest/lists.py
+++ b/src/mailman_pgp/rest/lists.py
@@ -21,9 +21,9 @@ from mailman.interfaces.action import Action
from mailman.interfaces.listmanager import IListManager
from mailman.interfaces.member import MemberRole
from mailman.rest.helpers import (accepted, bad_request,
- child, CollectionMixin, etag, GetterSetter,
- no_content, not_found, NotFound, okay,
- ChildError)
+ child, ChildError, CollectionMixin, etag,
+ GetterSetter, no_content, not_found,
+ NotFound, okay)
from mailman.rest.validator import (enum_validator, PatchValidator,
UnknownPATCHRequestError, Validator)
from pgpy.errors import PGPError
@@ -35,8 +35,8 @@ from mailman_pgp.database import transaction
from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.utils.pgp import key_from_blob
from mailman_pgp.utils.rest import enumflag_validator, workflow_validator
-from mailman_pgp.workflows.key_change import (KeyChangeWorkflow,
- KeyChangeModWorkflow)
+from mailman_pgp.workflows.key_change import (KeyChangeModWorkflow,
+ KeyChangeWorkflow)
CONFIGURATION = dict(
unsigned_msg_action=GetterSetter(enum_validator(Action)),
diff --git a/src/mailman_pgp/rest/tests/test_lists.py b/src/mailman_pgp/rest/tests/test_lists.py
index 900e8b9..7b21023 100644
--- a/src/mailman_pgp/rest/tests/test_lists.py
+++ b/src/mailman_pgp/rest/tests/test_lists.py
@@ -24,7 +24,6 @@ from mailman.interfaces.action import Action
from mailman.testing.helpers import call_api
from pgpy import PGPKey
-from mailman_pgp.config import config
from mailman_pgp.database import mm_transaction, transaction
from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.testing.layers import PGPRESTLayer
@@ -114,12 +113,10 @@ class TestListConfig(TestCase):
for key in cfg:
attr = getattr(self.pgp_list, key)
if isinstance(attr, Action):
- self.assertEqual(attr.name, cfg[key])
+ attr = attr.name
elif key == 'key_signing_allowed':
- attr = [enum.name for enum in attr]
- self.assertEqual(attr, sorted(cfg[key]))
- else:
- self.assertEqual(attr, cfg[key])
+ attr = sorted(enum.name for enum in attr)
+ self.assertEqual(attr, cfg[key])
def test_put_wrong_value(self):
cfg = dict(unsigned_msg_action='not-an-action',