summaryrefslogtreecommitdiff
path: root/mail/src
diff options
context:
space:
mode:
Diffstat (limited to 'mail/src')
-rw-r--r--mail/src/leap/mail/incoming/tests/test_incoming_mail.py11
-rw-r--r--mail/src/leap/mail/outgoing/service.py2
-rw-r--r--mail/src/leap/mail/testing/__init__.py11
3 files changed, 8 insertions, 16 deletions
diff --git a/mail/src/leap/mail/incoming/tests/test_incoming_mail.py b/mail/src/leap/mail/incoming/tests/test_incoming_mail.py
index 09a7e1e1..29422ecc 100644
--- a/mail/src/leap/mail/incoming/tests/test_incoming_mail.py
+++ b/mail/src/leap/mail/incoming/tests/test_incoming_mail.py
@@ -94,11 +94,6 @@ subject: independence of cyberspace
self.tempdir = tempfile.mkdtemp()
def getCollection(_):
- #d = defer.Deferred()
- #acct = IMAPAccount(self._soledad, ADDRESS, d=d)
- #d.addCallback(
- #lambda _: acct.getMailbox(INBOX_NAME))
- #return d
adaptor = SoledadMailAdaptor()
store = self._soledad
adaptor.store = store
@@ -114,7 +109,8 @@ subject: independence of cyberspace
d = adaptor.initialize_store(store)
d.addCallback(lambda _: mbox_indexer.create_table(mbox_uuid))
- d.addCallback(lambda _: adaptor.get_or_create_mbox(store, mbox_name))
+ d.addCallback(
+ lambda _: adaptor.get_or_create_mbox(store, mbox_name))
d.addCallback(get_collection_from_mbox_wrapper)
return d
@@ -277,6 +273,7 @@ subject: independence of cyberspace
def testAddDecryptedHeader(self):
class DummyMsg():
+
def __init__(self):
self.headers = {}
@@ -313,7 +310,7 @@ subject: independence of cyberspace
def decryption_error_not_called(_):
self.assertFalse(self.fetcher._decryption_error.called,
- "There was some errors with decryption")
+ "There was some errors with decryption")
def add_decrypted_header_called(_):
self.assertTrue(self.fetcher._add_decrypted_header.called,
diff --git a/mail/src/leap/mail/outgoing/service.py b/mail/src/leap/mail/outgoing/service.py
index 7699ce79..8b02f2e4 100644
--- a/mail/src/leap/mail/outgoing/service.py
+++ b/mail/src/leap/mail/outgoing/service.py
@@ -354,7 +354,7 @@ class OutgoingMail(object):
return d
def _encrypt_and_sign(self, origmsg, encrypt_address, sign_address,
- fetch_remote=True):
+ fetch_remote=True):
"""
Create an RFC 3156 compliang PGP encrypted and signed message using
C{encrypt_address} to encrypt and C{sign_address} to sign.
diff --git a/mail/src/leap/mail/testing/__init__.py b/mail/src/leap/mail/testing/__init__.py
index 982be557..8822a5c7 100644
--- a/mail/src/leap/mail/testing/__init__.py
+++ b/mail/src/leap/mail/testing/__init__.py
@@ -20,11 +20,9 @@ Base classes and keys for leap.mail tests.
import os
import distutils.spawn
from mock import Mock
-from twisted.internet.defer import gatherResults, succeed
+from twisted.internet.defer import gatherResults
from twisted.trial import unittest
-from twisted.web.client import Response
from twisted.internet import defer
-from twisted.python import log
from leap.soledad.client import Soledad
@@ -36,6 +34,7 @@ from leap.common.testing.basetest import BaseLeapTest
ADDRESS = 'leap@leap.se'
ADDRESS_2 = 'anotheruser@leap.se'
+
class defaultMockSharedDB(object):
get_doc = Mock(return_value=None)
put_doc = Mock(side_effect=None)
@@ -68,16 +67,12 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest):
class Response(object):
code = 200
phrase = ''
+
def deliverBody(self, x):
return ''
- # XXX why the fuck is this needed? ------------------------
self.km._async_client_pinned.request = Mock(
return_value=defer.succeed(Response()))
- #self.km._async_client.request = Mock(return_value='')
- #self.km._async_client_pinned.request = Mock(
- #return_value='')
- # -------------------------------------------------------
d1 = self.km.put_raw_key(PRIVATE_KEY, ADDRESS)
d2 = self.km.put_raw_key(PRIVATE_KEY_2, ADDRESS_2)