diff options
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/unit/config/test_leap.py | 5 | ||||
-rw-r--r-- | service/test/unit/config/test_sessions.py | 13 |
2 files changed, 2 insertions, 16 deletions
diff --git a/service/test/unit/config/test_leap.py b/service/test/unit/config/test_leap.py index 29f19f2f..3cfa43f2 100644 --- a/service/test/unit/config/test_leap.py +++ b/service/test/unit/config/test_leap.py @@ -14,7 +14,6 @@ # 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 leap.soledad.common.errors import InvalidAuthTokenError from mock import MagicMock, patch, Mock from twisted.trial import unittest from twisted.internet import defer @@ -170,7 +169,7 @@ class TestUserBootstrap(unittest.TestCase): @patch('pixelated.config.leap.create_leap_session') @patch('pixelated.config.leap.log.warn') @defer.inlineCallbacks - def test__setup__should_close_leap_sesson_on_error_from__setup_user_services(self, mock_logger_warn, mock_create_leap_session, mock_setup_user_services): + def test__setup__should_close_leap_session_on_error_from__setup_user_services(self, mock_logger_warn, mock_create_leap_session, mock_setup_user_services): leap_session = Mock() leap_session.close = Mock() mock_create_leap_session.return_value = leap_session @@ -184,7 +183,7 @@ class TestUserBootstrap(unittest.TestCase): @patch('pixelated.config.leap.create_leap_session') @patch('pixelated.config.leap.log.warn') @defer.inlineCallbacks - def test__setup__should_close_leap_sesson_on_error_from__add_welcome_email(self, mock_logger_warn, mock_create_leap_session, _, mock_add_welcome_email): + def test__setup__should_close_leap_session_on_error_from__add_welcome_email(self, mock_logger_warn, mock_create_leap_session, _, mock_add_welcome_email): leap_session = Mock() leap_session.close = Mock() mock_create_leap_session.return_value = leap_session diff --git a/service/test/unit/config/test_sessions.py b/service/test/unit/config/test_sessions.py index 06bffc97..b5e4029d 100644 --- a/service/test/unit/config/test_sessions.py +++ b/service/test/unit/config/test_sessions.py @@ -17,10 +17,8 @@ from mock import patch from mock import MagicMock -from mockito import when from twisted.internet import defer from pixelated.config.sessions import LeapSession, SessionCache, LeapSessionFactory, SoledadWrongPassphraseException -from pixelated.bitmask_libraries.keymanager import UploadKeyError from test.unit.bitmask_libraries.test_abstract_leap import AbstractLeapTest from leap.common.events.catalog import KEYMANAGER_FINISHED_KEY_GENERATION from leap.soledad.common.crypto import WrongMacError, UnknownMacMethodError @@ -44,17 +42,6 @@ class SessionTest(AbstractLeapTest): mail_fetcher_mock.startService.assert_called_once() @patch('pixelated.config.sessions.register') - @defer.inlineCallbacks - def test_upload_key_error_closes_the_session(self, _): - when(self.keymanager).generate_openpgp_key().thenRaise(UploadKeyError('Could not upload key')) - session = self._create_session() - session.close = MagicMock() - - with self.assertRaises(UploadKeyError): - yield session.finish_bootstrap() - session.close.assert_called_once() - - @patch('pixelated.config.sessions.register') @patch('pixelated.config.sessions.unregister') @patch('pixelated.config.sessions.Account') @defer.inlineCallbacks |