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

@ -16,10 +16,12 @@ class GenericFileMailbox(EmailTransport):
def get_instance(self):
return self._variant(self._path)
def get_message(self):
def get_message(self, condition=None):
repository = self.get_instance()
repository.lock()
for key, message in repository.items():
if condition and not condition(message):
continue
repository.remove(key)
yield message
repository.unlock()