diff options
author | drebs <drebs@leap.se> | 2013-03-12 16:16:30 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-03-12 16:16:30 -0300 |
commit | 167b737235b28036a64700933c22cb1c0842fa85 (patch) | |
tree | f28b8087020c21312a30fcab67e9c8e44f73050a /src/leap | |
parent | 5dcb6625991a6cd645037ea751d7e51e0d0ffba2 (diff) |
Add test for _has_symkey().
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/soledad/tests/test_crypto.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/leap/soledad/tests/test_crypto.py b/src/leap/soledad/tests/test_crypto.py index 04ca9e42..6be05243 100644 --- a/src/leap/soledad/tests/test_crypto.py +++ b/src/leap/soledad/tests/test_crypto.py @@ -173,3 +173,14 @@ class SoledadAuxMethods(BaseLeapTest): sol._init_db() from leap.soledad.backends.sqlcipher import SQLCipherDatabase self.assertIsInstance(sol._db, SQLCipherDatabase) + + def test__has_symkey(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) + self.assertFalse(sol._has_symkey()) + sol._gen_symkey() + self.assertTrue(sol._has_symkey()) |