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/rules | |
| parent | 43cc9d3e2c76c82bd00ce46ee7de6d69d07f3bb3 (diff) | |
| download | mailman-pgp-a0997fb8e5893fed2c2275ff0cfbfa892b261601.tar.gz mailman-pgp-a0997fb8e5893fed2c2275ff0cfbfa892b261601.tar.zst mailman-pgp-a0997fb8e5893fed2c2275ff0cfbfa892b261601.zip | |
Diffstat (limited to 'src/mailman_pgp/rules')
| -rw-r--r-- | src/mailman_pgp/rules/tests/test_signature.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mailman_pgp/rules/tests/test_signature.py b/src/mailman_pgp/rules/tests/test_signature.py index 827b187..4fd28ac 100644 --- a/src/mailman_pgp/rules/tests/test_signature.py +++ b/src/mailman_pgp/rules/tests/test_signature.py @@ -175,8 +175,8 @@ To: test@example.com self.pgp_list.duplicate_sig_action = Action.defer msgdata = {} - wrapped = MIMEWrapper(self.msg_clear) - msg = wrapped.sign(self.sender_key, expires=timedelta(seconds=1)) + wrapped = MIMEWrapper(self.msg_clear, True) + msg = wrapped.sign(self.sender_key, expires=timedelta(seconds=1)).msg time.sleep(2) matches = self.rule.check(self.mlist, msg, msgdata) @@ -184,11 +184,13 @@ To: test@example.com self.assertAction(msgdata, Action.hold, ['Signature is expired.']) msgdata = {} - wrapped = InlineWrapper(self.msg_clear) - msg = wrapped.sign(self.sender_key, expires=timedelta(seconds=1)) + wrapped = InlineWrapper(self.msg_clear, True) + msg = wrapped.sign(self.sender_key, expires=timedelta(seconds=1)).msg time.sleep(2) matches = self.rule.check(self.mlist, msg, msgdata) + # TODO: test when the key is expired + self.assertTrue(matches) self.assertAction(msgdata, Action.hold, ['Signature is expired.']) @@ -206,7 +208,7 @@ To: test@example.com msgdata = {} wrapped = MIMEWrapper(self.msg_clear) - msg = wrapped.sign(self.sender_key) + msg = wrapped.sign(self.sender_key).msg matches = self.rule.check(self.mlist, msg, msgdata) self.assertTrue(matches) |
