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

Commit

Permalink
Added tests for inbound message credit cutoff
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudi Giesler committed Mar 4, 2015
1 parent 0b665d3 commit 0177108
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion go/vumitools/tests/test_billing_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,39 @@ def test_outbound_message_credit_cutoff_message(self):
"outbound",
user_account="12345",
tag=("pool1", "1234"),
helper_metadata={},
helper_metadata={}
)

published_msgs = self.ri_helper.get_dispatched_outbound()
self.assertEqual(len(published_msgs), 0)

@inlineCallbacks
def test_inbound_message_credit_cutoff_session(self):
self.billing_api = BillingApiMock(credit_cutoff=True)
yield self.get_dispatcher

msg = yield self.make_dispatch_inbound(
"inbound",
user_account="12345",
tag=("pool1", "1234"),
helper_metadata={},
session_event='new'
)

published_msg = self.ri_helper.get_dispatched_inbound()[0]
self.assertEqual(msg, published_msg)

@inlineCallbacks
def test_inbound_message_credit_cutoff_message(self):
self.billing_api = BillingApiMock(credit_cutoff=True)
yield self.get_dispatcher

msg = yield self.make_dispatch_inbound(
"inbound",
user_account="12345",
tag=("pool1", "1234"),
helper_metadata={}
)

published_msg = self.ri_helper.get_dispatched_inbound()[0]
self.assertEqual(msg, published_msg)

0 comments on commit 0177108

Please sign in to comment.