diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-25 17:30:00 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-25 17:30:00 +0200 |
commit | 6eba069fdb566fd006fa48b8b9c5d5b44085f524 (patch) | |
tree | f2b4e5f58db35c659b33095b331905a5d282ed5b /service/test/unit/adapter | |
parent | cbf8c2208da4e2cf9f4ae9d5551b0ceaa1de4ea9 (diff) |
Add repair to pixelated maintenance
- Issue #468
- Call with: pixelated-maintenance repair
Diffstat (limited to 'service/test/unit/adapter')
-rw-r--r-- | service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py b/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py index dc5d9d6c..9a89d62b 100644 --- a/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py +++ b/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py @@ -87,6 +87,18 @@ class TestSoledadMaintenance(unittest.TestCase): verify(soledad, never).delete_doc(other_doc) + @defer.inlineCallbacks + def test_repair_recreates_public_key_active_doc_if_necessary(self): + soledad = mock() + + private_key = self._private_key(SOME_EMAIL_ADDRESS, SOME_KEY_ID) + private_key_doc = SoledadDocument(doc_id='some_doc', json=private_key.get_json()) + when(soledad).get_all_docs().thenReturn(defer.succeed((1, [private_key_doc]))) + + yield SoledadMaintenance(soledad).repair() + + verify(soledad).create_doc_from_json('{"key_id": "4914254E384E264C", "tags": ["keymanager-active"], "type": "OpenPGPKey-active", "private": false, "address": "foo@example.tld"}') + def _public_key(self, address, keyid): return self._gpgkey(address, keyid, private=False) |