forked from mirror/django-mailbox
Adding a more-versatile condition-handling method for preventing integration tests from mashing on one another.
This commit is contained in:
parent
3e1f6b9909
commit
988cb7504f
6 changed files with 17 additions and 17 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue