aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/runners/tests/test_incoming.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/runners/tests/test_incoming.py')
-rw-r--r--src/mailman_pgp/runners/tests/test_incoming.py28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/mailman_pgp/runners/tests/test_incoming.py b/src/mailman_pgp/runners/tests/test_incoming.py
index 05e910a..aaf597c 100644
--- a/src/mailman_pgp/runners/tests/test_incoming.py
+++ b/src/mailman_pgp/runners/tests/test_incoming.py
@@ -87,11 +87,10 @@ To: no-key@example.com
Some text.
""")
- wrapped = PGPWrapper(msg)
- encrypted = wrapped.encrypt(self.pgp_list.pubkey)
+ PGPWrapper(msg).encrypt(self.pgp_list.pubkey)
msgdata = dict(listid='no-key.example.com')
- mm_config.switchboards['in'].enqueue(encrypted, msgdata)
+ mm_config.switchboards['in'].enqueue(msg, msgdata)
runner = make_testable_runner(PGPIncomingRunner, 'in',
lambda runner: True)
runner.run()
@@ -130,12 +129,10 @@ To: test@example.com
{}
""".format(str(payload)))
- wrapped = PGPWrapper(msg)
- encrypted = wrapped.encrypt(self.pgp_list.pubkey)
+ encrypted = PGPWrapper(msg).copy().encrypt(self.pgp_list.pubkey).msg
msgdata = dict(listid='test.example.com')
- mm_config.switchboards['in'].enqueue(encrypted,
- msgdata)
+ mm_config.switchboards['in'].enqueue(encrypted, msgdata)
self.runner.run()
items = get_queue_messages('in_default', expected_count=1)
out_msg = items[0].msg
@@ -149,14 +146,13 @@ To: test@example.com
{}
""".format(str(payload)))
- wrapped = PGPWrapper(msg)
- encrypted_signed = wrapped.sign_encrypt(self.sender_key,
- self.pgp_list.pubkey,
- self.pgp_sender.key)
+ PGPWrapper(msg).sign_encrypt(self.sender_key,
+ self.pgp_list.pubkey,
+ self.pgp_sender.key)
msgdata = dict(listid='test.example.com')
- mm_config.switchboards['in'].enqueue(encrypted_signed,
- msgdata)
+ mm_config.switchboards['in'].enqueue(msg, msgdata)
+
self.runner.run()
items = get_queue_messages('in_default', expected_count=1)
out_msg = items[0].msg
@@ -173,12 +169,10 @@ To: test@example.com
{}
""".format(str(payload)))
- wrapped = PGPWrapper(msg)
- encrypted = wrapped.encrypt(self.sender_key.pubkey)
+ PGPWrapper(msg).encrypt(self.sender_key.pubkey)
msgdata = dict(listid='test.example.com')
- mm_config.switchboards['in'].enqueue(encrypted,
- msgdata)
+ mm_config.switchboards['in'].enqueue(msg, msgdata)
self.runner.run()
items = get_queue_messages('in_default', expected_count=1)
self.assertEqual(items[0].msgdata['pgp_action'],