From eefc09382e62303871773063fc285ce39d118bb9 Mon Sep 17 00:00:00 2001 From: J08nY Date: Thu, 10 Aug 2017 20:55:51 +0200 Subject: Fix REST list test. --- src/mailman_pgp/rest/lists.py | 10 +++++----- src/mailman_pgp/rest/tests/test_lists.py | 9 +++------ 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', -- cgit v1.2.3-70-g09d2