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

Commit

Permalink
Wait for window manager instead of ountbound messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Feb 25, 2015
1 parent 04d5d4a commit 2f1ddfb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions go/apps/bulk_message/tests/test_vumi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def test_consume_events(self):
msg_options={},
)
window_id = self.app.get_window_id(conversation.key, batch_id)
yield self.app_helper.kick_delivery()
self.clock.advance(self.app.monitor_interval + 1)
yield self.wait_for_window_monitor()

Expand Down Expand Up @@ -142,11 +141,11 @@ def test_bulk_send_command(self):
delivery_class="sms",
msg_options={},
)
yield self.app_helper.kick_delivery()
self.clock.advance(self.app.monitor_interval + 1)
yield self.wait_for_window_monitor()

contacts = yield self.get_opted_in_contacts(conversation)
msgs = yield self.app_helper.wait_for_dispatched_outbound(10)
msgs = yield self.app_helper.get_dispatched_outbound()
contact_addrs = sorted([contact.msisdn for contact in contacts])
msg_addrs = sorted([msg["to_addr"] for msg in msgs])
self.assertEqual(contact_addrs, msg_addrs)
Expand All @@ -173,11 +172,11 @@ def test_bulk_send_command_with_duplicates(self):
delivery_class="sms",
msg_options={},
)
yield self.app_helper.kick_delivery()
self.clock.advance(self.app.monitor_interval + 1)
yield self.wait_for_window_monitor()

contacts = yield self.get_opted_in_contacts(conversation)
msgs = yield self.app_helper.wait_for_dispatched_outbound(8)
msgs = yield self.app_helper.get_dispatched_outbound()
contact_addrs = sorted([contact.msisdn for contact in contacts])
# Make sure we have duplicate addresses.
self.assertNotEqual(len(contact_addrs), len(set(contact_addrs)))
Expand Down Expand Up @@ -207,11 +206,11 @@ def test_bulk_send_command_with_duplicates_dedupe(self):
delivery_class="sms",
msg_options={},
)
yield self.app_helper.kick_delivery()
self.clock.advance(self.app.monitor_interval + 1)
yield self.wait_for_window_monitor()

contacts = yield self.get_opted_in_contacts(conversation)
msgs = yield self.app_helper.wait_for_dispatched_outbound(5)
msgs = yield self.app_helper.get_dispatched_outbound()
contact_addrs = sorted([contact.msisdn for contact in contacts])
msg_addrs = sorted([msg["to_addr"] for msg in msgs])
self.assertNotEqual(contact_addrs, msg_addrs)
Expand Down

0 comments on commit 2f1ddfb

Please sign in to comment.