summaryrefslogtreecommitdiff
path: root/src/leap/soledad/tests/__init__.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-04-13 12:33:59 -0300
committerdrebs <drebs@leap.se>2013-04-13 12:33:59 -0300
commit7d63e687e4c3b6e4da4599a7e685dc5c44457a64 (patch)
treec5caa8ca6d7a21dba66523f877e23569a46272aa /src/leap/soledad/tests/__init__.py
parent3e0d12b8130a317c11da5145bb878b70b3bd8cac (diff)
Use BaseConfig for configuring Soledad.
Diffstat (limited to 'src/leap/soledad/tests/__init__.py')
-rw-r--r--src/leap/soledad/tests/__init__.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/leap/soledad/tests/__init__.py b/src/leap/soledad/tests/__init__.py
index 8ceafe99..1dbbe8ab 100644
--- a/src/leap/soledad/tests/__init__.py
+++ b/src/leap/soledad/tests/__init__.py
@@ -31,9 +31,7 @@ class BaseSoledadTest(BaseLeapTest):
self._db2 = u1db.open(self.db2_file, create=True,
document_factory=LeapDocument)
# initialize soledad by hand so we can control keys
- self._soledad = Soledad(self.email, gnupg_home=self.gnupg_home,
- bootstrap=False,
- prefix=self.tempdir)
+ self._soledad = self._soledad_instance(user=self.email)
self._soledad._init_dirs()
self._soledad._gpg = GPGWrapper(gnupghome=self.gnupg_home)
#self._soledad._gpg.import_keys(PUBLIC_KEY)
@@ -49,6 +47,20 @@ class BaseSoledadTest(BaseLeapTest):
self._db2.close()
self._soledad.close()
+ def _soledad_instance(self, user='leap@leap.se', prefix='',
+ bootstrap=False, gnupg_home='/gnupg',
+ secret_path='/secret.gpg',
+ local_db_path='/soledad.u1db'):
+ return Soledad(
+ user,
+ gnupg_home=self.tempdir+prefix+gnupg_home,
+ secret_path=self.tempdir+prefix+secret_path,
+ local_db_path=self.tempdir+prefix+local_db_path,
+ bootstrap=bootstrap)
+
+ def _gpgwrapper_instance(self):
+ return GPGWrapper(gnupghome="%s/gnupg" % self.tempdir)
+
# Key material for testing
KEY_FINGERPRINT = "E36E738D69173C13D709E44F2F455E2824D18DDF"