aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/mta/tests/test_personalized.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/mta/tests/test_personalized.py')
-rw-r--r--src/mailman_pgp/mta/tests/test_personalized.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mailman_pgp/mta/tests/test_personalized.py b/src/mailman_pgp/mta/tests/test_personalized.py
index d9d0132..9200a3b 100644
--- a/src/mailman_pgp/mta/tests/test_personalized.py
+++ b/src/mailman_pgp/mta/tests/test_personalized.py
@@ -162,4 +162,20 @@ Subject: test
refused = agent.deliver(ordinary_list, self.msg, msgdata)
self.assertEqual(len(refused), 0)
- self.assertEqual(len(agent.deliveries), 1) \ No newline at end of file
+ self.assertEqual(len(agent.deliveries), 1)
+
+ def test_no_pgp_address(self):
+ msgdata = dict(recipients=['someone@example.org'])
+ agent = PGPPersonalizedDelivery()
+ refused = agent.deliver(self.mlist, self.msg, msgdata)
+
+ self.assertEqual(len(refused), 1)
+
+ def test_no_key(self):
+ with transaction():
+ self.pgp_anne.key = None
+ msgdata = dict(recipients=['anne@example.org'])
+ agent = PGPPersonalizedDelivery()
+ refused = agent.deliver(self.mlist, self.msg, msgdata)
+
+ self.assertEqual(len(refused), 1)