summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/tests/__init__.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-04-25 19:18:35 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-04-25 19:18:35 -0400
commit0f600595dd2d26bc16174435dbf0c3accd690982 (patch)
tree826f4fc4d69255a365f09faeba3119610a154400 /src/leap/keymanager/tests/__init__.py
parent4e5e21a8d008fd31307d3581fb5f791b0c2783e8 (diff)
parent90a1df64f6a5df09a289eeb322a77e2e984569aa (diff)
Merge tag '0.5.0' into debian/experimental
Tag leap.bitmask version 0.5.0
Diffstat (limited to 'src/leap/keymanager/tests/__init__.py')
-rw-r--r--src/leap/keymanager/tests/__init__.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/leap/keymanager/tests/__init__.py b/src/leap/keymanager/tests/__init__.py
index cd612c4..20d05e8 100644
--- a/src/leap/keymanager/tests/__init__.py
+++ b/src/leap/keymanager/tests/__init__.py
@@ -54,6 +54,14 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest):
def tearDown(self):
km = self._key_manager()
+ # wait for the indexes to be ready for the tear down
+ d = km._wrapper_map[OpenPGPKey].deferred_init
+ d.addCallback(lambda _: self.delete_all_keys(km))
+ d.addCallback(lambda _: self.tearDownEnv())
+ d.addCallback(lambda _: self._soledad.close())
+ return d
+
+ def delete_all_keys(self, km):
def delete_keys(keys):
deferreds = []
for key in keys:
@@ -61,26 +69,18 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest):
deferreds.append(d)
return gatherResults(deferreds)
- def get_and_delete_keys(_):
- deferreds = []
- for private in [True, False]:
- d = km.get_all_keys(private=private)
- d.addCallback(delete_keys)
- d.addCallback(check_deleted, private)
- deferreds.append(d)
- return gatherResults(deferreds)
-
def check_deleted(_, private):
d = km.get_all_keys(private=private)
d.addCallback(lambda keys: self.assertEqual(keys, []))
return d
- # wait for the indexes to be ready for the tear down
- d = km._wrapper_map[OpenPGPKey].deferred_indexes
- d.addCallback(get_and_delete_keys)
- d.addCallback(lambda _: self.tearDownEnv())
- d.addCallback(lambda _: self._soledad.close())
- return d
+ deferreds = []
+ for private in [True, False]:
+ d = km.get_all_keys(private=private)
+ d.addCallback(delete_keys)
+ d.addCallback(check_deleted, private)
+ deferreds.append(d)
+ return gatherResults(deferreds)
def _key_manager(self, user=ADDRESS, url='', token=None,
ca_cert_path=None):
@@ -97,7 +97,6 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest):
# key 24D18DDF: public key "Leap Test Key <leap@leap.se>"
-KEY_ID = "2F455E2824D18DDF"
KEY_FINGERPRINT = "E36E738D69173C13D709E44F2F455E2824D18DDF"
PUBLIC_KEY = """
-----BEGIN PGP PUBLIC KEY BLOCK-----