diff options
author | Kali Kaneko <kali@leap.se> | 2016-08-25 11:09:47 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-08-25 11:13:23 -0400 |
commit | 8e4746835a1a053558ff06d4fd12b31167a80296 (patch) | |
tree | 56421a7b58ef5c050dbe0706e31e9496075ee055 /mail/src | |
parent | 8c49f1e16e8743acf994ec96aaf005275e8f54d5 (diff) |
[tests] pep8 fixes + add pep8 step to tox run
Diffstat (limited to 'mail/src')
-rw-r--r-- | mail/src/leap/mail/incoming/tests/test_incoming_mail.py | 11 | ||||
-rw-r--r-- | mail/src/leap/mail/outgoing/service.py | 2 | ||||
-rw-r--r-- | mail/src/leap/mail/testing/__init__.py | 11 |
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) |