diff options
| author | J08nY | 2017-07-11 23:00:53 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-11 23:00:53 +0200 |
| commit | 329532bc05f83edb4cd23e2ae82da777511c9857 (patch) | |
| tree | 4bf54d0928a2ff7b23cd0dd3882373f2e16ca635 /src | |
| parent | 44bde427fdcc78344892f3413597c7be66eca8e9 (diff) | |
| download | mailman-pgp-329532bc05f83edb4cd23e2ae82da777511c9857.tar.gz mailman-pgp-329532bc05f83edb4cd23e2ae82da777511c9857.tar.zst mailman-pgp-329532bc05f83edb4cd23e2ae82da777511c9857.zip | |
Add more tests for workflows.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman_pgp/workflows/base.py | 1 | ||||
| -rw-r--r-- | src/mailman_pgp/workflows/tests/test_base.py | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/mailman_pgp/workflows/base.py b/src/mailman_pgp/workflows/base.py index ace8f91..1e6b867 100644 --- a/src/mailman_pgp/workflows/base.py +++ b/src/mailman_pgp/workflows/base.py @@ -100,7 +100,6 @@ class PubkeyMixin: # The workflow was confirmed but we still dont have an address # or the pubkey. So resend request and wait. self.push('send_key_request') - return else: self.pubkey = pgp_address.key if not self.pubkey_confirmed: diff --git a/src/mailman_pgp/workflows/tests/test_base.py b/src/mailman_pgp/workflows/tests/test_base.py index c99c6d6..4f39296 100644 --- a/src/mailman_pgp/workflows/tests/test_base.py +++ b/src/mailman_pgp/workflows/tests/test_base.py @@ -189,3 +189,20 @@ class TestPubkeyMixin(unittest.TestCase): with patch.object(receive_workflow, '_step_do_subscription') as step: next(receive_workflow) step.assert_called_once_with() + + def test_exisitng_pgp_address(self): + workflow = ConfirmSubscriptionPolicy(self.mlist, self.sender, + pre_verified=True, + pre_confirmed=True) + + with transaction() as t: + pgp_address = PGPAddress(self.sender) + pgp_address.key = self.sender_key.pubkey + pgp_address.key_confirmed = True + t.add(pgp_address) + + workflow.run_thru('pubkey_checks') + next(workflow) + with patch.object(workflow, '_step_do_subscription') as step: + next(workflow) + step.assert_called_once_with() |
