Skip to content

Commit

Permalink
pep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaderabbit committed Jul 11, 2014
1 parent 83aa036 commit 7b2958e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 7 additions & 6 deletions vxaat/tests/test_ussd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def assert_outbound_message(self, msg, content, callback,
if continue_session:
options = (
'<options>'
'<option callback="%s" command="1" display="false" order="1" />'
'<option callback="%s" command="1" display="false"'
' order="1" />'
'</options>'
) % callback
else:
Expand Down Expand Up @@ -82,7 +83,7 @@ def assert_nack(self, nack, reply, reason):
def test_inbound_begin(self):

# Send initial request
d = self.tx_helper.mk_request('')
d = self.tx_helper.mk_request()
[msg] = yield self.tx_helper.wait_for_dispatched_inbound(1)

self.assert_inbound_message(
Expand All @@ -109,7 +110,7 @@ def test_inbound_begin(self):
def test_inbound_begin_with_close(self):

# Send initial request
d = self.tx_helper.mk_request('')
d = self.tx_helper.mk_request()
[msg] = yield self.tx_helper.wait_for_dispatched_inbound(1)

self.assert_inbound_message(
Expand Down Expand Up @@ -137,7 +138,7 @@ def test_inbound_begin_with_close(self):
def test_inbound_resume_and_reply_with_end(self):

user_content = "I didn't expect a kind of Spanish Inquisition!"
d = self.tx_helper.mk_request('', request=user_content)
d = self.tx_helper.mk_request(request=user_content)
[msg] = yield self.tx_helper.wait_for_dispatched_inbound(1)
self.assert_inbound_message(
msg,
Expand All @@ -164,7 +165,7 @@ def test_inbound_resume_and_reply_with_end(self):
def test_inbound_resume_and_reply_with_resume(self):

user_content = "Well, what is it you want?"
d = self.tx_helper.mk_request('some-suffix', request=user_content)
d = self.tx_helper.mk_request(request=user_content)
[msg] = yield self.tx_helper.wait_for_dispatched_inbound(1)
self.assert_inbound_message(
msg,
Expand All @@ -185,4 +186,4 @@ def test_inbound_resume_and_reply_with_resume(self):
)

[ack] = yield self.tx_helper.wait_for_dispatched_events(1)
self.assert_ack(ack, reply)
self.assert_ack(ack, reply)
6 changes: 4 additions & 2 deletions vxaat/ussd.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class AatUssdTransport(HttpRpcTransport):
EXPECTED_FIELDS = set(['msisdn', 'provider'])
IGNORE_FIELDS = set(['request'])

# errors
RESPONSE_FAILURE_ERROR = "Response to http request failed."
INSUFFICIENT_MSG_FIELDS_ERROR = "Insufficiant message fields provided."

CONFIG_CLASS = AatUssdTransportConfig

def get_callback_url(self):
Expand All @@ -34,7 +38,6 @@ def get_callback_url(self):
config.base_url,
config.web_path)


@inlineCallbacks
def handle_raw_inbound_message(self, message_id, request):
errors = {}
Expand Down Expand Up @@ -133,4 +136,3 @@ def handle_outbound_message(self, message):

yield self.publish_ack(user_message_id=message_id,
sent_message_id=message_id)

0 comments on commit 7b2958e

Please sign in to comment.