diff options
author | drebs <drebs@leap.se> | 2013-03-12 16:17:37 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-03-12 16:18:32 -0300 |
commit | 779fec037c012de6cfe77dd5cd6211feecd2e894 (patch) | |
tree | 2f60530f5ad52b9e60562df61e8fb4fcbe657eb9 /src | |
parent | 167b737235b28036a64700933c22cb1c0842fa85 (diff) |
Add test for _has_privkey().
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/soledad/tests/test_crypto.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/soledad/tests/test_crypto.py b/src/leap/soledad/tests/test_crypto.py index 6be05243..4936b56c 100644 --- a/src/leap/soledad/tests/test_crypto.py +++ b/src/leap/soledad/tests/test_crypto.py @@ -174,11 +174,18 @@ class SoledadAuxMethods(BaseLeapTest): from leap.soledad.backends.sqlcipher import SQLCipherDatabase self.assertIsInstance(sol._db, SQLCipherDatabase) + def test__has_privkey(self): + sol = self._soledad_instance() + sol._init_dirs() + sol._gpg = GPGWrapper(gnupghome="%s/gnupg" % self.tempdir) + self.assertFalse(sol._has_privkey()) + sol._set_privkey(PRIVATE_KEY) + self.assertTrue(sol._has_privkey()) + 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()) |