aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman_pgp/config/tests/test_config.py6
-rw-r--r--src/mailman_pgp/config/tests/test_converter.py4
-rw-r--r--src/mailman_pgp/config/tests/test_validator.py4
-rw-r--r--src/mailman_pgp/model/tests/test_db_key.py4
-rw-r--r--src/mailman_pgp/model/tests/test_fs_key.py4
-rw-r--r--src/mailman_pgp/model/tests/test_list.py3
-rw-r--r--src/mailman_pgp/mta/tests/test_deliver.py4
-rw-r--r--src/mailman_pgp/pgp/tests/test_keygen.py4
-rw-r--r--src/mailman_pgp/pgp/tests/test_pgp.py4
-rw-r--r--src/mailman_pgp/rest/tests/test_lists.py8
-rw-r--r--src/mailman_pgp/rules/tests/test_encryption.py4
-rw-r--r--src/mailman_pgp/rules/tests/test_signature.py6
-rw-r--r--src/mailman_pgp/runners/tests/test_incoming.py4
-rw-r--r--src/mailman_pgp/styles/tests/test_announce.py4
-rw-r--r--src/mailman_pgp/styles/tests/test_base.py5
-rw-r--r--src/mailman_pgp/styles/tests/test_discussion.py4
-rw-r--r--src/mailman_pgp/testing/pgp.py4
-rw-r--r--src/mailman_pgp/tests/test_plugin.py10
-rw-r--r--src/mailman_pgp/utils/tests/test_pgp.py6
-rw-r--r--src/mailman_pgp/workflows/tests/test_mod_approval.py5
20 files changed, 49 insertions, 48 deletions
diff --git a/src/mailman_pgp/config/tests/test_config.py b/src/mailman_pgp/config/tests/test_config.py
index d3ef9ea..74f4eb8 100644
--- a/src/mailman_pgp/config/tests/test_config.py
+++ b/src/mailman_pgp/config/tests/test_config.py
@@ -16,7 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from unittest import TestCase
+import unittest
from pkg_resources import resource_filename, resource_string
@@ -26,14 +26,14 @@ from mailman_pgp.config.validator import ConfigValidator
from mailman_pgp.testing.layers import PGPConfigLayer, PGPLayer
-class TestConfig(TestCase):
+class TestConfig(unittest.TestCase):
layer = PGPConfigLayer
def test_name(self):
self.assertEqual(config.name, 'pgp')
-class TestConfigs(TestCase):
+class TestConfigs(unittest.TestCase):
layer = PGPLayer
def setUp(self):
diff --git a/src/mailman_pgp/config/tests/test_converter.py b/src/mailman_pgp/config/tests/test_converter.py
index 842ccc4..551be16 100644
--- a/src/mailman_pgp/config/tests/test_converter.py
+++ b/src/mailman_pgp/config/tests/test_converter.py
@@ -16,14 +16,14 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from unittest import TestCase
+import unittest
from mailman_pgp.config.config import Config
from mailman_pgp.config.converter import ConfigConverter
from mailman_pgp.testing.layers import PGPLayer
-class TestConverter(TestCase):
+class TestConverter(unittest.TestCase):
layer = PGPLayer
def test_builtins(self):
diff --git a/src/mailman_pgp/config/tests/test_validator.py b/src/mailman_pgp/config/tests/test_validator.py
index 10beba6..56e9c54 100644
--- a/src/mailman_pgp/config/tests/test_validator.py
+++ b/src/mailman_pgp/config/tests/test_validator.py
@@ -16,14 +16,14 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from unittest import TestCase
+import unittest
from mailman_pgp.config.config import Config
from mailman_pgp.config.validator import ConfigValidator
from mailman_pgp.testing.layers import PGPLayer
-class TestValidator(TestCase):
+class TestValidator(unittest.TestCase):
layer = PGPLayer
def test_missing_section(self):
diff --git a/src/mailman_pgp/model/tests/test_db_key.py b/src/mailman_pgp/model/tests/test_db_key.py
index 46cc487..3041f0c 100644
--- a/src/mailman_pgp/model/tests/test_db_key.py
+++ b/src/mailman_pgp/model/tests/test_db_key.py
@@ -16,7 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from unittest import TestCase
+import unittest
from mailman_pgp.config import config
from mailman_pgp.database import transaction
@@ -25,7 +25,7 @@ from mailman_pgp.testing.layers import PGPConfigLayer
from mailman_pgp.testing.pgp import load_key
-class TestDBKey(TestCase):
+class TestDBKey(unittest.TestCase):
layer = PGPConfigLayer
def test_key(self):
diff --git a/src/mailman_pgp/model/tests/test_fs_key.py b/src/mailman_pgp/model/tests/test_fs_key.py
index 18c9a29..61af097 100644
--- a/src/mailman_pgp/model/tests/test_fs_key.py
+++ b/src/mailman_pgp/model/tests/test_fs_key.py
@@ -17,16 +17,16 @@
""""""
import time
+import unittest
from os.path import exists, join
from tempfile import TemporaryDirectory
-from unittest import TestCase
from mailman_pgp.model.fs_key import FSKey
from mailman_pgp.testing.layers import PGPLayer
from mailman_pgp.testing.pgp import load_key
-class TestFSKey(TestCase):
+class TestFSKey(unittest.TestCase):
layer = PGPLayer
def setUp(self):
diff --git a/src/mailman_pgp/model/tests/test_list.py b/src/mailman_pgp/model/tests/test_list.py
index eb43355..e437607 100644
--- a/src/mailman_pgp/model/tests/test_list.py
+++ b/src/mailman_pgp/model/tests/test_list.py
@@ -19,7 +19,6 @@
import shutil
import unittest
from os.path import exists
-from unittest import TestCase
from mailman.app.lifecycle import create_list
from mailman.interfaces.listmanager import IListManager
@@ -32,7 +31,7 @@ from mailman_pgp.testing.layers import PGPConfigLayer
from mailman_pgp.testing.pgp import load_key
-class TestPGPMailingList(TestCase):
+class TestPGPMailingList(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
diff --git a/src/mailman_pgp/mta/tests/test_deliver.py b/src/mailman_pgp/mta/tests/test_deliver.py
index 3406d02..b6d2fc5 100644
--- a/src/mailman_pgp/mta/tests/test_deliver.py
+++ b/src/mailman_pgp/mta/tests/test_deliver.py
@@ -16,7 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from unittest import TestCase
+import unittest
from mailman.app.lifecycle import create_list
from mailman.interfaces.mailinglist import Personalization
@@ -32,7 +32,7 @@ from mailman_pgp.testing.layers import PGPSMTPLayer
from mailman_pgp.testing.pgp import load_key
-class TestDeliver(TestCase):
+class TestDeliver(unittest.TestCase):
layer = PGPSMTPLayer
def setUp(self):
diff --git a/src/mailman_pgp/pgp/tests/test_keygen.py b/src/mailman_pgp/pgp/tests/test_keygen.py
index 7de1a19..b3c6070 100644
--- a/src/mailman_pgp/pgp/tests/test_keygen.py
+++ b/src/mailman_pgp/pgp/tests/test_keygen.py
@@ -16,8 +16,8 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
"""Test the out-of-process key generator."""
+import unittest
from os.path import exists, isfile
-from unittest import TestCase
from mailman.app.lifecycle import create_list
from parameterized import parameterized
@@ -31,7 +31,7 @@ from mailman_pgp.testing.layers import PGPConfigLayer
from mailman_pgp.utils.pgp import key_from_file
-class TestKeygen(TestCase):
+class TestKeygen(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
diff --git a/src/mailman_pgp/pgp/tests/test_pgp.py b/src/mailman_pgp/pgp/tests/test_pgp.py
index 6ef531e..0acde58 100644
--- a/src/mailman_pgp/pgp/tests/test_pgp.py
+++ b/src/mailman_pgp/pgp/tests/test_pgp.py
@@ -16,7 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
"""Tests for the module global PGP instance."""
-from unittest import TestCase
+import unittest
from mailman.app.lifecycle import create_list
from mailman.testing.helpers import subscribe
@@ -30,7 +30,7 @@ from mailman_pgp.testing.layers import PGPConfigLayer
from mailman_pgp.testing.pgp import load_key
-class TestPGP(TestCase):
+class TestPGP(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
diff --git a/src/mailman_pgp/rest/tests/test_lists.py b/src/mailman_pgp/rest/tests/test_lists.py
index c97c392..70bcc16 100644
--- a/src/mailman_pgp/rest/tests/test_lists.py
+++ b/src/mailman_pgp/rest/tests/test_lists.py
@@ -16,8 +16,8 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
+import unittest
from copy import copy
-from unittest import TestCase
from urllib.error import HTTPError
from mailman.app.lifecycle import create_list
@@ -32,7 +32,7 @@ from mailman_pgp.testing.layers import PGPRESTLayer
from mailman_pgp.testing.pgp import load_key
-class TestLists(TestCase):
+class TestLists(unittest.TestCase):
layer = PGPRESTLayer
def setUp(self):
@@ -79,7 +79,7 @@ class TestLists(TestCase):
self.assertEqual(json['list_id'], self.mlist.list_id)
-class TestListConfig(TestCase):
+class TestListConfig(unittest.TestCase):
layer = PGPRESTLayer
def setUp(self):
@@ -213,7 +213,7 @@ class TestListConfig(TestCase):
self.assertEqual(cm.exception.code, 404)
-class TestListKey(TestCase):
+class TestListKey(unittest.TestCase):
layer = PGPRESTLayer
def setUp(self):
diff --git a/src/mailman_pgp/rules/tests/test_encryption.py b/src/mailman_pgp/rules/tests/test_encryption.py
index eaa4898..001f80a 100644
--- a/src/mailman_pgp/rules/tests/test_encryption.py
+++ b/src/mailman_pgp/rules/tests/test_encryption.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-from unittest import TestCase
+import unittest
from mailman.app.lifecycle import create_list
from mailman.testing.helpers import specialized_message_from_string as mfs
@@ -25,7 +25,7 @@ from mailman_pgp.rules.encryption import Encryption
from mailman_pgp.testing.layers import PGPConfigLayer
-class TestPGPEncryptionRule(TestCase):
+class TestPGPEncryptionRule(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
diff --git a/src/mailman_pgp/rules/tests/test_signature.py b/src/mailman_pgp/rules/tests/test_signature.py
index 73dbb6c..827b187 100644
--- a/src/mailman_pgp/rules/tests/test_signature.py
+++ b/src/mailman_pgp/rules/tests/test_signature.py
@@ -17,8 +17,8 @@
""""""
import time
+import unittest
from datetime import timedelta
-from unittest import TestCase
from mailman.app.lifecycle import create_list
from mailman.email.message import Message
@@ -47,7 +47,7 @@ from mailman_pgp.testing.pgp import load_key, load_message
from mailman_pgp.utils.pgp import hashes
-class TestPGPSignatureRule(TestCase):
+class TestPGPSignatureRule(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
@@ -264,7 +264,7 @@ To: test@example.com
self.assertAction(msgdata, Action.hold, ['Signature duplicate.'])
-class TestPostingEvent(TestCase):
+class TestPostingEvent(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
diff --git a/src/mailman_pgp/runners/tests/test_incoming.py b/src/mailman_pgp/runners/tests/test_incoming.py
index 48e9ae4..05e910a 100644
--- a/src/mailman_pgp/runners/tests/test_incoming.py
+++ b/src/mailman_pgp/runners/tests/test_incoming.py
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-from unittest import TestCase
+import unittest
from mailman.app.lifecycle import create_list
from mailman.interfaces.action import Action
@@ -35,7 +35,7 @@ from mailman_pgp.testing.layers import PGPConfigLayer
from mailman_pgp.testing.pgp import load_key, load_message
-class TestPGPIncomingRunner(TestCase):
+class TestPGPIncomingRunner(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):
diff --git a/src/mailman_pgp/styles/tests/test_announce.py b/src/mailman_pgp/styles/tests/test_announce.py
index 13f665b..3aadee2 100644
--- a/src/mailman_pgp/styles/tests/test_announce.py
+++ b/src/mailman_pgp/styles/tests/test_announce.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-from unittest import TestCase
+import unittest
from mailman.app.lifecycle import create_list
@@ -24,7 +24,7 @@ from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.testing.layers import PGPConfigLayer
-class TestAnnounceStyle(TestCase):
+class TestAnnounceStyle(unittest.TestCase):
layer = PGPConfigLayer
def test_create(self):
diff --git a/src/mailman_pgp/styles/tests/test_base.py b/src/mailman_pgp/styles/tests/test_base.py
index 50d9981..8db9bf8 100644
--- a/src/mailman_pgp/styles/tests/test_base.py
+++ b/src/mailman_pgp/styles/tests/test_base.py
@@ -14,7 +14,8 @@
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-from unittest import TestCase
+
+import unittest
from mailman.app.lifecycle import create_list
@@ -24,7 +25,7 @@ from mailman_pgp.testing.config import patch_config
from mailman_pgp.testing.layers import PGPConfigLayer
-class TestBaseStyle(TestCase):
+class TestBaseStyle(unittest.TestCase):
layer = PGPConfigLayer
def test_apply(self):
diff --git a/src/mailman_pgp/styles/tests/test_discussion.py b/src/mailman_pgp/styles/tests/test_discussion.py
index 9056971..4201b6d 100644
--- a/src/mailman_pgp/styles/tests/test_discussion.py
+++ b/src/mailman_pgp/styles/tests/test_discussion.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-from unittest import TestCase
+import unittest
from mailman.app.lifecycle import create_list
@@ -24,7 +24,7 @@ from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.testing.layers import PGPConfigLayer
-class TestDiscussionStyle(TestCase):
+class TestDiscussionStyle(unittest.TestCase):
layer = PGPConfigLayer
def test_create(self):
diff --git a/src/mailman_pgp/testing/pgp.py b/src/mailman_pgp/testing/pgp.py
index 89f7a98..afb62c8 100644
--- a/src/mailman_pgp/testing/pgp.py
+++ b/src/mailman_pgp/testing/pgp.py
@@ -18,9 +18,9 @@
""""""
import os
+import unittest
from email import message_from_bytes
from operator import attrgetter
-from unittest import TestCase
from mailman.email.message import Message
from pgpy import PGPKey
@@ -71,7 +71,7 @@ def payload_equal(one_msg, other_msg):
return one_payload == other_payload
-class WrapperTestCase(TestCase):
+class WrapperTestCase(unittest.TestCase):
layer = PGPLayer
wrapper = None
maxDiff = None
diff --git a/src/mailman_pgp/tests/test_plugin.py b/src/mailman_pgp/tests/test_plugin.py
index c216226..99ec110 100644
--- a/src/mailman_pgp/tests/test_plugin.py
+++ b/src/mailman_pgp/tests/test_plugin.py
@@ -15,18 +15,18 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-from unittest import TestCase
-from mailman.config import config as mailman_config
+import unittest
+from mailman_pgp.config import mm_config
from mailman_pgp.plugin import PGPMailman
from mailman_pgp.testing.layers import PGPConfigLayer
-class TestPlugin(TestCase):
+class TestPlugin(unittest.TestCase):
layer = PGPConfigLayer
def test_instance_loaded(self):
- self.assertIn('pgp', mailman_config.plugins.keys())
- instance = mailman_config.plugins['pgp']
+ self.assertIn('pgp', mm_config.plugins.keys())
+ instance = mm_config.plugins['pgp']
self.assertIsInstance(instance, PGPMailman)
diff --git a/src/mailman_pgp/utils/tests/test_pgp.py b/src/mailman_pgp/utils/tests/test_pgp.py
index 26b1be9..679e8bc 100644
--- a/src/mailman_pgp/utils/tests/test_pgp.py
+++ b/src/mailman_pgp/utils/tests/test_pgp.py
@@ -18,7 +18,7 @@
""""""
import datetime
import time
-from unittest import TestCase
+import unittest
from parameterized import parameterized
from pgpy import PGPKey, PGPUID
@@ -31,7 +31,7 @@ from mailman_pgp.testing.pgp import load_blob, load_key
from mailman_pgp.utils.pgp import key_usable, revoc_from_blob
-class TestPGPUtils(TestCase):
+class TestPGPUtils(unittest.TestCase):
layer = PGPLayer
@parameterized.expand([
@@ -99,4 +99,4 @@ class TestPGPUtils(TestCase):
sub |= rsig
self.assertFalse(
- key_usable(key.pubkey, {KeyFlags.EncryptCommunications}))
+ key_usable(key.pubkey, {KeyFlags.EncryptCommunications}))
diff --git a/src/mailman_pgp/workflows/tests/test_mod_approval.py b/src/mailman_pgp/workflows/tests/test_mod_approval.py
index 7d57a9b..cab2eb1 100644
--- a/src/mailman_pgp/workflows/tests/test_mod_approval.py
+++ b/src/mailman_pgp/workflows/tests/test_mod_approval.py
@@ -16,7 +16,8 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from unittest import TestCase
+
+import unittest
from mailman.app.lifecycle import create_list
from mailman.interfaces.subscriptions import TokenOwner
@@ -52,7 +53,7 @@ class PGPTestWorkflow(KeyChangeBase, ModeratorKeyChangeApprovalMixin):
ModeratorKeyChangeApprovalMixin.__init__(self, pre_approved)
-class TestModeratorApprovalMixin(TestCase):
+class TestModeratorApprovalMixin(unittest.TestCase):
layer = PGPConfigLayer
def setUp(self):