From 779fec037c012de6cfe77dd5cd6211feecd2e894 Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 12 Mar 2013 16:17:37 -0300 Subject: Add test for _has_privkey(). --- src/leap/soledad/tests/test_crypto.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/leap/soledad/tests') 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()) -- cgit v1.2.3