1
0
Fork 0

Adding a more-versatile condition-handling method for preventing integration tests from mashing on one another.

This commit is contained in:
Adam Coddington 2015-07-07 22:22:15 -07:00
parent 3e1f6b9909
commit 988cb7504f
6 changed files with 17 additions and 17 deletions

View file

@ -82,7 +82,7 @@ class ImapTransport(EmailTransport):
pass
return safe_message_ids
def get_message(self):
def get_message(self, condition=None):
message_ids = self._get_all_message_ids()
if not message_ids:
@ -105,10 +105,7 @@ class ImapTransport(EmailTransport):
continue
message = self.get_email_from_bytes(msg_contents[0][1])
if (
self.integration_testing_subject and
message['Subject'] != self.integration_testing_subject
):
if condition and not condition(message):
continue
yield message