diff options
Diffstat (limited to 'src/mailman_pgp/rules/tests/test_signature.py')
| -rw-r--r-- | src/mailman_pgp/rules/tests/test_signature.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mailman_pgp/rules/tests/test_signature.py b/src/mailman_pgp/rules/tests/test_signature.py index ec49a18..45dbf21 100644 --- a/src/mailman_pgp/rules/tests/test_signature.py +++ b/src/mailman_pgp/rules/tests/test_signature.py @@ -32,7 +32,7 @@ from zope.component import getUtility from zope.event import notify from mailman_pgp.chains.default import PGPChain -from mailman_pgp.config import mm_config +from mailman_pgp.config import mm_config, config from mailman_pgp.database import mm_transaction, transaction from mailman_pgp.model.address import PGPAddress from mailman_pgp.model.list import PGPMailingList @@ -41,6 +41,7 @@ from mailman_pgp.pgp.inline import InlineWrapper from mailman_pgp.pgp.mime import MIMEWrapper from mailman_pgp.pgp.wrapper import PGPWrapper from mailman_pgp.rules.signature import Signature +from mailman_pgp.testing.config import patch_config from mailman_pgp.testing.layers import PGPConfigLayer from mailman_pgp.testing.pgp import load_key, load_message from mailman_pgp.utils.pgp import hashes @@ -299,6 +300,17 @@ class TestPostingEvent(TestCase): self.assertIsNotNone(sig_hash) self.assertEqual(sig_hash.fingerprint, self.sender_key.fingerprint) + @patch_config('misc', 'collect_sig_hashes', 'no') + def test_no_collect(self): + msg = load_message('mime_signed.eml') + wrapped = PGPWrapper(msg) + sighashes = set(hashes(wrapped.verify(self.sender_key))) + msgdata = dict(pgp_sig_hashes=sighashes) + notify(AcceptEvent(self.mlist, msg, msgdata, + mm_config.chains[PGPChain.name])) + + self.assertEqual(0, len(PGPSigHash.query().all())) + def test_no_pgp_list(self): with mm_transaction(): mlist = create_list('ordinary@example.com') |
