summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTulio Casagrande <tcasagra@thoughtworks.com>2017-01-21 11:48:08 -0200
committerTulio Casagrande <tcasagra@thoughtworks.com>2017-01-21 12:10:19 -0200
commita966e35f5d3eda2cdcd39899e9bce6db6b4da73a (patch)
treecf2df31805e011c5d32f770dfdde06cc36330e84
parent3d3c620ac53de1c407ff2ff222d923310770ed62 (diff)
Remove old UploadKeyError test
I was surprised this test was not working correctly.
-rw-r--r--service/pixelated/config/sessions.py5
-rw-r--r--service/test/unit/config/test_sessions.py13
2 files changed, 1 insertions, 17 deletions
diff --git a/service/pixelated/config/sessions.py b/service/pixelated/config/sessions.py
index b4d69d29..eb233a9f 100644
--- a/service/pixelated/config/sessions.py
+++ b/service/pixelated/config/sessions.py
@@ -18,9 +18,7 @@ from __future__ import absolute_import
import os
import errno
-import traceback
import requests
-import sys
from twisted.internet import defer, threads, reactor
from twisted.logger import Logger
@@ -35,10 +33,9 @@ from leap.common.events import (
catalog as events
)
-from pixelated.bitmask_libraries.keymanager import Keymanager, UploadKeyError
+from pixelated.bitmask_libraries.keymanager import Keymanager
from pixelated.adapter.mailstore import LeapMailStore
from pixelated.config import leap_config
-from pixelated.bitmask_libraries.certs import LeapCertificate
from pixelated.bitmask_libraries.smtp import LeapSMTPConfig
logger = Logger()
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