Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feature/adhoc-pypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Mar 31, 2015
2 parents 6b78dad + c43d414 commit e73384a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion go/apps/bulk_message/tests/test_vumi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
from go.vumitools.api import VumiApiCommand


class BreakerError(Exception):
"""
An exception we can flush without clearing other errors.
"""


class MessageSendBreaker(object):
"""
A helper to break message sending during a bulk send.
Expand All @@ -39,7 +45,7 @@ def _broken_send(self, *args, **kw):
Send up to self.allow messages, then raise an exception.
"""
if self._messages_sent >= self.allow:
raise Exception("oops")
raise BreakerError("oops")
self._messages_sent += 1
return self._send_message_via_window(*args, **kw)

Expand Down Expand Up @@ -359,6 +365,8 @@ def test_interrupted_bulk_send_command_with_duplicates(self):
send_progress = yield self.app.get_send_progress(conversation, cmd_id)
self.assertEqual(send_progress, None)

self.flushLoggedErrors(BreakerError)

@inlineCallbacks
def test_interrupted_bulk_send_command_with_duplicates_dedupe(self):
"""
Expand Down Expand Up @@ -426,6 +434,8 @@ def test_interrupted_bulk_send_command_with_duplicates_dedupe(self):
send_progress = yield self.app.get_send_progress(conversation, cmd_id)
self.assertEqual(send_progress, None)

self.flushLoggedErrors(BreakerError)

@inlineCallbacks
def test_overlapping_bulk_send_commands(self):
"""
Expand Down

0 comments on commit e73384a

Please sign in to comment.