Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pass through all Gather attributes #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/unit/twiml/test_voice_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,26 @@ def test_empty(self):
'<?xml version="1.0" encoding="UTF-8"?><Response><Gather /></Response>'
)

def test_gather_full(self):
r = VoiceResponse()
r.gather(
action='action',
method='method',
timeout='timeout',
finish_on_key='finish_on_key',
num_digits='num_digits',
partial_result_callback='partial_result_callback',
partial_result_callback_method='partial_result_callback_method',
language='language',
hints='hints',
barge_in='barge_in',
acknowledge_sound_url='acknowledge_sound_url',
)
assert_equal(
self.strip(r),
'<?xml version="1.0" encoding="UTF-8"?><Response><Gather acknowledgeSoundUrl="acknowledge_sound_url" action="action" bargeIn="barge_in" finishOnKey="finish_on_key" hints="hints" language="language" method="method" numDigits="num_digits" partialResultCallback="partial_result_callback" partialResultCallbackMethod="partial_result_callback_method" timeout="timeout" /></Response>'
)

def test_gather_say(self):
g = Gather()
g.say('Hello')
Expand Down
6 changes: 6 additions & 0 deletions twilio/twiml/voice_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ def gather(self,
timeout=timeout,
finish_on_key=finish_on_key,
num_digits=num_digits,
partial_result_callback=partial_result_callback,
partial_result_callback_method=partial_result_callback_method,
language=language,
hints=hints,
barge_in=barge_in,
acknowledge_sound_url=acknowledge_sound_url,
**kwargs
))

Expand Down