summaryrefslogtreecommitdiff
path: root/src/mailman_pgp/commands/tests/test_key.py
diff options
context:
space:
mode:
authorJ08nY2017-08-02 17:01:21 +0200
committerJ08nY2017-08-02 17:01:21 +0200
commit2681a5cd91b2563a24cf41b5dafe491bae6106ab (patch)
tree76bdaa4f9e83c750b5a88794a9dacf2174f753a5 /src/mailman_pgp/commands/tests/test_key.py
parent27b6d62dc288b110fce2d80533cb6c6294370fde (diff)
downloadmailman-pgp-2681a5cd91b2563a24cf41b5dafe491bae6106ab.tar.gz
mailman-pgp-2681a5cd91b2563a24cf41b5dafe491bae6106ab.tar.zst
mailman-pgp-2681a5cd91b2563a24cf41b5dafe491bae6106ab.zip
Diffstat (limited to 'src/mailman_pgp/commands/tests/test_key.py')
-rw-r--r--src/mailman_pgp/commands/tests/test_key.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/mailman_pgp/commands/tests/test_key.py b/src/mailman_pgp/commands/tests/test_key.py
index 0c7d7c7..674438d 100644
--- a/src/mailman_pgp/commands/tests/test_key.py
+++ b/src/mailman_pgp/commands/tests/test_key.py
@@ -27,13 +27,13 @@ from mailman.runners.command import CommandRunner
from mailman.testing.helpers import get_queue_messages, make_testable_runner
from mailman.utilities.datetime import now
from pgpy import PGPKey, PGPUID
-from pgpy.constants import (PubKeyAlgorithm, KeyFlags, EllipticCurveOID,
- HashAlgorithm, SymmetricKeyAlgorithm,
- CompressionAlgorithm)
+from pgpy.constants import (
+ CompressionAlgorithm, EllipticCurveOID, HashAlgorithm, KeyFlags,
+ PubKeyAlgorithm, SymmetricKeyAlgorithm)
from zope.component import getUtility
from mailman_pgp.config import mm_config
-from mailman_pgp.database import transaction
+from mailman_pgp.database import transaction, mm_transaction
from mailman_pgp.model.address import PGPAddress
from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.pgp.mime import MIMEWrapper
@@ -128,8 +128,7 @@ class TestPreSubscription(unittest.TestCase):
hashes=[HashAlgorithm.SHA256,
HashAlgorithm.SHA512],
ciphers=[SymmetricKeyAlgorithm.AES256],
- compression=[CompressionAlgorithm.ZLIB,
- CompressionAlgorithm.Uncompressed]
+ compression=[CompressionAlgorithm.ZLIB]
)
def test_set(self):
@@ -594,9 +593,13 @@ class TestAfterSubscription(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
- self.mlist = create_list('test@example.com', style_name='pgp-default')
- self.pgp_list = PGPMailingList.for_list(self.mlist)
- self.pgp_list.key = load_key('ecc_p256.priv.asc')
+ with mm_transaction():
+ self.mlist = create_list('test@example.com',
+ style_name='pgp-default')
+ with transaction():
+ self.pgp_list = PGPMailingList.for_list(self.mlist)
+ self.pgp_list.key = load_key('ecc_p256.priv.asc')
+ self.pgp_list.key_change_workflow = 'pgp-key-change-workflow'
self.bart_key = load_key('rsa_1024.priv.asc')
self.bart_new_key = load_key('ecc_p256.priv.asc')
@@ -611,8 +614,7 @@ class TestAfterSubscription(unittest.TestCase):
hashes=[HashAlgorithm.SHA256,
HashAlgorithm.SHA512],
ciphers=[SymmetricKeyAlgorithm.AES256],
- compression=[CompressionAlgorithm.ZLIB,
- CompressionAlgorithm.Uncompressed]
+ compression=[CompressionAlgorithm.ZLIB]
)
def test_change(self):