diff options
author | Bruno Wagner <bwgpro@gmail.com> | 2015-07-21 20:11:29 -0300 |
---|---|---|
committer | Bruno Wagner <bwgpro@gmail.com> | 2015-07-21 20:11:29 -0300 |
commit | c07fa6959abda3cbf185186a41e9bca51c14031b (patch) | |
tree | 4d3363ed75e47504c0b61a9e8ae76cd61534959a /mail/src | |
parent | 939a618de67ab685deb30d7f21ad796b3276059d (diff) |
Changed imap tests and messages assigned lambdas to functions because of pep8
Diffstat (limited to 'mail/src')
-rw-r--r-- | mail/src/leap/mail/imap/messages.py | 7 | ||||
-rw-r--r-- | mail/src/leap/mail/imap/tests/test_imap.py | 18 |
2 files changed, 18 insertions, 7 deletions
diff --git a/mail/src/leap/mail/imap/messages.py b/mail/src/leap/mail/imap/messages.py index 9af4c99a..d1c7b93c 100644 --- a/mail/src/leap/mail/imap/messages.py +++ b/mail/src/leap/mail/imap/messages.py @@ -217,10 +217,13 @@ def _format_headers(headers, negate, *names): return {str('content-type'): str('')} names = map(lambda s: s.upper(), names) + if negate: - cond = lambda key: key.upper() not in names + def cond(key): + return key.upper() not in names else: - cond = lambda key: key.upper() in names + def cond(key): + return key.upper() in names if isinstance(headers, list): headers = dict(headers) diff --git a/mail/src/leap/mail/imap/tests/test_imap.py b/mail/src/leap/mail/imap/tests/test_imap.py index ffe59c35..62c3c419 100644 --- a/mail/src/leap/mail/imap/tests/test_imap.py +++ b/mail/src/leap/mail/imap/tests/test_imap.py @@ -387,8 +387,11 @@ class LEAPIMAP4ServerTestCase(IMAP4HelperMixin): acc.addMailbox('this/mbox'), acc.addMailbox('that/mbox')]) - dc1 = lambda: acc.subscribe('this/mbox') - dc2 = lambda: acc.subscribe('that/mbox') + def dc1(): + return acc.subscribe('this/mbox') + + def dc2(): + return acc.subscribe('that/mbox') def login(): return self.client.login(TEST_USER, TEST_PASSWD) @@ -668,9 +671,14 @@ class LEAPIMAP4ServerTestCase(IMAP4HelperMixin): acc = self.server.theAccount - dc1 = lambda: acc.addMailbox('root_subthing', creation_ts=42) - dc2 = lambda: acc.addMailbox('root_another_thing', creation_ts=42) - dc3 = lambda: acc.addMailbox('non_root_subthing', creation_ts=42) + def dc1(): + return acc.addMailbox('root_subthing', creation_ts=42) + + def dc2(): + return acc.addMailbox('root_another_thing', creation_ts=42) + + def dc3(): + return acc.addMailbox('non_root_subthing', creation_ts=42) def login(): return self.client.login(TEST_USER, TEST_PASSWD) |