diff options
| author | J08nY | 2017-07-06 23:21:01 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-06 23:21:01 +0200 |
| commit | 2c4c5cb0c122d3bf6700276ec6cdd2c28ba36a9a (patch) | |
| tree | a3cc2347eae4157a79c3cc53a94ecdcaab426524 /src/mailman_pgp | |
| parent | 2b93808035a9d152eb7164424b767497160188bf (diff) | |
| download | mailman-pgp-2c4c5cb0c122d3bf6700276ec6cdd2c28ba36a9a.tar.gz mailman-pgp-2c4c5cb0c122d3bf6700276ec6cdd2c28ba36a9a.tar.zst mailman-pgp-2c4c5cb0c122d3bf6700276ec6cdd2c28ba36a9a.zip | |
Diffstat (limited to 'src/mailman_pgp')
| -rw-r--r-- | src/mailman_pgp/plugin.py | 3 | ||||
| -rw-r--r-- | src/mailman_pgp/runners/tests/test_incoming.py | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/mailman_pgp/plugin.py b/src/mailman_pgp/plugin.py index 2a8207c..2b59236 100644 --- a/src/mailman_pgp/plugin.py +++ b/src/mailman_pgp/plugin.py @@ -52,8 +52,7 @@ class PGPMailman: @classhandler.handler(ListDeletedEvent) def on_delete(mlist): - pgp_list = PGPMailingList.query().filter_by( - list_id=mlist.list_id).first() + pgp_list = PGPMailingList.for_list(mlist) if pgp_list: with transaction() as session: # TODO shred the list key diff --git a/src/mailman_pgp/runners/tests/test_incoming.py b/src/mailman_pgp/runners/tests/test_incoming.py index f98aede..f879bc5 100644 --- a/src/mailman_pgp/runners/tests/test_incoming.py +++ b/src/mailman_pgp/runners/tests/test_incoming.py @@ -49,6 +49,8 @@ class TestIncoming(TestCase): self.mlist.subscribe(self.sender, MemberRole.member) self.pgp_list = PGPMailingList.for_list(self.mlist) + while self.pgp_list.pubkey is None: + sleep(1) sender_key = load_key('data/rsa_1024.pub.asc') with transaction() as t: @@ -102,11 +104,6 @@ To: ordinary@example.com get_queue_messages('in_default', expected_count=1) def test_decrypt(self): - for i in range(15): # pragma: no cover - if self.pgp_list.pubkey is not None: - break - sleep(1) - payload = 'Some encrypted text.' pmsg = PGPMessage.new(payload) emsg = self.pgp_list.pubkey.encrypt(pmsg) |
