Add missing test case for `add_key` and `delete_key`
This commit is contained in:
parent
2215886850
commit
46bb125684
|
@ -37,6 +37,15 @@ class GnuPGUtilitiesTest(unittest.TestCase):
|
||||||
|
|
||||||
self.assertDictEqual(keys, known_identities)
|
self.assertDictEqual(keys, known_identities)
|
||||||
|
|
||||||
|
def test_add_delete_key(self):
|
||||||
|
self.assertDictEqual(GnuPG.public_keys('/tmp'), { })
|
||||||
|
GnuPG.add_key('/tmp', self._load('test/keys/bob@disposlab.pub'))
|
||||||
|
self.assertDictEqual(GnuPG.public_keys('/tmp'), {
|
||||||
|
'19CF4B47ECC9C47AFA84D4BD96F39FDA0E31BB67': 'bob@disposlab',
|
||||||
|
})
|
||||||
|
GnuPG.delete_key('/tmp', 'bob@disposlab')
|
||||||
|
self.assertDictEqual(GnuPG.public_keys('/tmp'), { })
|
||||||
|
|
||||||
def _load(self, filename):
|
def _load(self, filename):
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
Loading…
Reference in New Issue