diff options
| author | J08nY | 2017-08-23 20:12:10 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-23 20:12:10 +0200 |
| commit | a0997fb8e5893fed2c2275ff0cfbfa892b261601 (patch) | |
| tree | 926f093cbe087a8c7f69705f159fe85ff8799caa /src/mailman_pgp/runners/tests/test_incoming.py | |
| parent | 43cc9d3e2c76c82bd00ce46ee7de6d69d07f3bb3 (diff) | |
| download | mailman-pgp-a0997fb8e5893fed2c2275ff0cfbfa892b261601.tar.gz mailman-pgp-a0997fb8e5893fed2c2275ff0cfbfa892b261601.tar.zst mailman-pgp-a0997fb8e5893fed2c2275ff0cfbfa892b261601.zip | |
Diffstat (limited to 'src/mailman_pgp/runners/tests/test_incoming.py')
| -rw-r--r-- | src/mailman_pgp/runners/tests/test_incoming.py | 28 |
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'], |
