summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/mail
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-02-27 15:44:50 -0300
committerKali Kaneko (leap communications) <kali@leap.se>2017-02-27 20:55:07 +0100
commitbcfd0c7fd461876d080bca14ed4d038837834f02 (patch)
tree7d6fb992d38e97270a5169983cf7bdeb90cc4b2e /src/leap/bitmask/mail
parente266869facbfc1097e7e25a536e1b2dfa454583e (diff)
[test] pass a fake shared db to soledad during tests
Diffstat (limited to 'src/leap/bitmask/mail')
-rw-r--r--src/leap/bitmask/mail/testing/common.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/leap/bitmask/mail/testing/common.py b/src/leap/bitmask/mail/testing/common.py
index c77148da..d969deef 100644
--- a/src/leap/bitmask/mail/testing/common.py
+++ b/src/leap/bitmask/mail/testing/common.py
@@ -50,6 +50,19 @@ def _initialize_soledad(email, gnupg_home, tempdir):
server_url = "https://provider"
cert_file = ""
+ # TODO: we pass a fake shared database to soledad because we don't want
+ # it o try to reach network to lookup a stored secret in the shared
+ # database. This logic still has to be improved in soledad itself to
+ # account for tests, and when that is done we can remove this from
+ # here.
+ class FakeSharedDb(object):
+
+ def get_doc(self, doc_id):
+ return None
+
+ def put_doc(self, doc):
+ return None
+
soledad = Soledad(
uuid,
passphrase,
@@ -57,7 +70,8 @@ def _initialize_soledad(email, gnupg_home, tempdir):
local_db_path,
server_url,
cert_file,
- offline=True)
+ offline=True,
+ shared_db=FakeSharedDb())
return soledad