summaryrefslogtreecommitdiff
path: root/service/test/bitmask_libraries/nicknym_test.py
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-09 12:03:31 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-09 12:03:38 +0200
commit0bad14f4b0e6dd5128660d94a436463cbe7dc720 (patch)
tree1c6170b1e29a09360378253da3fa3aeca9433641 /service/test/bitmask_libraries/nicknym_test.py
parente605929f9be56f01795fdc904d98cbe3f91984e3 (diff)
Changing tests folder structure
Diffstat (limited to 'service/test/bitmask_libraries/nicknym_test.py')
-rw-r--r--service/test/bitmask_libraries/nicknym_test.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/service/test/bitmask_libraries/nicknym_test.py b/service/test/bitmask_libraries/nicknym_test.py
deleted file mode 100644
index 9d564abe..00000000
--- a/service/test/bitmask_libraries/nicknym_test.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (c) 2014 ThoughtWorks, Inc.
-#
-# Pixelated is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Pixelated is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
-from mock import patch
-
-from leap.keymanager import openpgp, KeyNotFound
-from pixelated.bitmask_libraries.nicknym import NickNym
-from abstract_leap_test import AbstractLeapTest
-
-
-class NickNymTest(AbstractLeapTest):
- @patch('pixelated.bitmask_libraries.nicknym.KeyManager.__init__', return_value=None)
- def test_that_keymanager_is_created(self, init_mock):
- # given
-
- # when
- NickNym(self.provider, self.config, self.soledad_session, self.srp_session)
-
- # then
- init_mock.assert_called_with('test_user@some-server.test', 'https://nicknym.some-server.test:6425/',
- self.soledad, self.token, '/some/path/to/ca_cert',
- 'https://api.some-server.test:4430', '1', self.uuid,
- '/path/to/gpg')
-
- @patch('pixelated.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
- 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)