Skip to content

Commit

Permalink
Merge branch 'feature/issue-7-support-hangup-verb' into feature/issue…
Browse files Browse the repository at this point in the history
…-8-support-gather-verb

Conflicts:
	vumi_twilio_api/tests/test_twilio_api.py
	vumi_twilio_api/twilio_api.py
  • Loading branch information
Rudi Giesler committed Apr 13, 2015
2 parents 3c4c994 + c266693 commit 21dc4e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions vumi_twilio_api/tests/test_twilio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,18 @@ def test_make_all_parsing_gather_verb_subverbs(self):
with response.gather() as g:
g.play('test_url')
g.play('test_url2')
print str(response)
self.twiml_server.add_response('default.xml', response)

yield self._twilio_client_create_call(
'default.xml', from_='+12345', to='+54321')
[msg] = yield self.app_helper.wait_for_dispatched_outbound(1)
yield self.app_helper.dispatch_event(self.app_helper.make_ack(msg))
[_, reply1, reply2] = yield self.app_helper.wait_for_dispatched_outbound(1)
[_, reply1, reply2] = (
yield self.app_helper.wait_for_dispatched_outbound(1))
self.assertEqual(
reply1['helper_metadata']['voice']['speech_url'], 'test_url')
self.assertEqual(
reply2['helper_metadata']['voice']['speech_url'], 'test_url2')
reply2['helper_metadata']['voice']['speech_url'], 'test_url2')

@inlineCallbacks
def test_receive_call(self):
Expand All @@ -486,7 +486,8 @@ def test_receive_call_parsing_play_verb(self):
yield self.app_helper.dispatch_inbound(msg)
[reply] = yield self.app_helper.wait_for_dispatched_outbound(1)

self.assertEqual(reply['helper_metadata']['voice']['url'], 'test_url')
self.assertEqual(
reply['helper_metadata']['voice']['speech_url'], 'test_url')
self.assertEqual(reply['in_reply_to'], msg['message_id'])

@inlineCallbacks
Expand Down
2 changes: 1 addition & 1 deletion vumi_twilio_api/twilio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def new_session(self, message):
elif verb.name == "Play":
yield self.reply_to(message, '', helper_metadata={
'voice': {
'url': verb.nouns[0],
'speech_url': verb.nouns[0],
}
})
elif verb.name == "Hangup":
Expand Down

0 comments on commit 21dc4e1

Please sign in to comment.