From 0a85b99d444fbdcfb221e266ee3ce081c1f3675c Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 19 Feb 2013 19:28:17 -0300 Subject: Add ability to load configuration from ini file. --- tests/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests') 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): -- cgit v1.2.3