diff options
-rw-r--r-- | mail/setup.cfg | 7 | ||||
-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 | ||||
-rw-r--r-- | mail/tox.ini | 5 |
5 files changed, 18 insertions, 18 deletions
diff --git a/mail/setup.cfg b/mail/setup.cfg index 501ecf1b..a49fd352 100644 --- a/mail/setup.cfg +++ b/mail/setup.cfg @@ -9,6 +9,13 @@ ignore = E731 exclude = versioneer.py,_version.py,*.egg,build,docs ignore = E731 +[tool:pytest] +pep8ignore = + docs/conf.py ALL + versioneer.py ALL + _version.py ALL + *.egg ALL + [versioneer] VCS = git style = pep440 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) diff --git a/mail/tox.ini b/mail/tox.ini index ff4299d4..e2393f74 100644 --- a/mail/tox.ini +++ b/mail/tox.ini @@ -2,13 +2,14 @@ envlist = py27 [testenv] -commands = py.test {posargs} +commands = py.test --pep8 {posargs} deps = mock + pep8 pytest + pytest-pep8 pdbpp setuptools-trial - pep8 -e../soledad/common -e../soledad/client -e../keymanager |