diff options
author | drebs <drebs@leap.se> | 2013-02-19 19:28:17 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-19 19:28:17 -0300 |
commit | 0a85b99d444fbdcfb221e266ee3ce081c1f3675c (patch) | |
tree | 124a48002f40ba584b3aba3a3329bb2919ed9a39 /tests | |
parent | fdc02ee65765b86bd7b2b0cd456c5c2ceee334c5 (diff) |
Add ability to load configuration from ini file.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/__init__.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index d8927e36..394a13d8 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -4,6 +4,7 @@ Tests to make sure Soledad provides U1DB functionality and more. import u1db from leap.soledad import Soledad +from leap.soledad.util import GPGWrapper from leap.soledad.backends.leap_backend import LeapDocument from leap.testing.basetest import BaseLeapTest @@ -29,13 +30,18 @@ class BaseSoledadTest(BaseLeapTest): document_factory=LeapDocument) self._db2 = u1db.open(self.db2_file, create=True, document_factory=LeapDocument) - # open a soledad instance - self._soledad = Soledad(self.email, gnupghome=self.gnupg_home, + # initialize soledad by hand so we can control keys + self._soledad = Soledad(self.email, gnupg_home=self.gnupg_home, initialize=False, prefix=self.tempdir) + self._soledad._init_dirs() + self._soledad._gpg = GPGWrapper(gnupghome=self.gnupg_home) self._soledad._gpg.import_keys(PUBLIC_KEY) self._soledad._gpg.import_keys(PRIVATE_KEY) - self._soledad._init_crypto() + self._soledad._load_openpgp_keypair() + if not self._soledad._has_secret(): + self._soledad._gen_secret() + self._soledad._load_secret() self._soledad._init_db() def tearDown(self): |