summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-03-12 16:14:17 -0300
committerdrebs <drebs@leap.se>2013-03-12 16:14:17 -0300
commit5dcb6625991a6cd645037ea751d7e51e0d0ffba2 (patch)
tree5d85434e080b00121ec58f58143afdacd8763983
parent708803f3a8b40263ccb3061e320010e35f218474 (diff)
Add test for _init_db().
-rw-r--r--src/leap/soledad/tests/test_crypto.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/leap/soledad/tests/test_crypto.py b/src/leap/soledad/tests/test_crypto.py
index ca7502af..04ca9e42 100644
--- a/src/leap/soledad/tests/test_crypto.py
+++ b/src/leap/soledad/tests/test_crypto.py
@@ -159,3 +159,17 @@ class SoledadAuxMethods(BaseLeapTest):
sol = self._soledad_instance()
sol._init_dirs()
self.assertTrue(os.path.isdir(sol.prefix))
+
+ def test__init_db(self):
+ sol = self._soledad_instance()
+ sol._init_dirs()
+ sol._gpg = GPGWrapper(gnupghome="%s/gnupg" % self.tempdir)
+ #self._soledad._gpg.import_keys(PUBLIC_KEY)
+ if not sol._has_privkey():
+ sol._set_privkey(PRIVATE_KEY)
+ if not sol._has_symkey():
+ sol._gen_symkey()
+ sol._load_symkey()
+ sol._init_db()
+ from leap.soledad.backends.sqlcipher import SQLCipherDatabase
+ self.assertIsInstance(sol._db, SQLCipherDatabase)