diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-08-06 12:05:32 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-08-06 12:05:32 +0200 |
commit | e4b81f84ca0946382cbd6f09c3f700afcc166cf9 (patch) | |
tree | c1a920fd5d0097005f6d5c6a3ac7711b7176f895 /service/test | |
parent | 1e1fd328bc43e820e178de7c08f626b1488505e1 (diff) |
Added openpgp key generation.
- Not yet usable because of API incompatibilities
- (needs upgrade of LEAP python deps to latest version)
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/bitmask_libraries/nicknym_test.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/service/test/bitmask_libraries/nicknym_test.py b/service/test/bitmask_libraries/nicknym_test.py index a087874a..46c70371 100644 --- a/service/test/bitmask_libraries/nicknym_test.py +++ b/service/test/bitmask_libraries/nicknym_test.py @@ -1,5 +1,6 @@ from mock import patch +from leap.keymanager import openpgp, KeyNotFound from app.bitmask_libraries.nicknym import NickNym from abstract_leap_test import AbstractLeapTest @@ -17,3 +18,16 @@ class NickNymTest(AbstractLeapTest): self.soledad, self.session_id, '/some/path/to/ca_cert', 'https://api.some-server.test:4430', '1', self.uuid, '/path/to/gpg') + + @patch('app.bitmask_libraries.nicknym.KeyManager') + def test_gen_key(self, keymanager_mock): + #given + keyman = keymanager_mock.return_value + keyman.get_key.side_effect = KeyNotFound + nicknym = NickNym(self.provider, self.config, self.soledad_session, self.srp_session) + + #when/then + self.assertRaises(NotImplementedError, nicknym.generate_openpgp_key) + + keyman.get_key.assert_called_with('test_user@some-server.test', openpgp.OpenPGPKey, fetch_remote=False, private=True) + keyman.gen_key.assert_called_with(openpgp.OpenPGPKey) |