8000 Make url parameter optional · burhan/twilio-python@d288b13 · GitHub
[go: up one dir, main page]

Skip to content

Commit d288b13

Browse files
committed
Make url parameter optional
1 parent 21fc89a commit d288b13

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tests/unit/twiml/test_voice_response.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class TestPlay(TwilioTest):
120120
def test_empty_play(self):
121121
""" should play hello monkey """
122122
r = VoiceResponse()
123-
r.play('')
123+
r.play()
124124

125125
assert_equal(
126126
self.strip(r),
@@ -130,7 +130,7 @@ def test_empty_play(self):
130130
def test_play_hello(self):
131131
""" should play hello monkey """
132132
r = VoiceResponse()
133-
r.play('http://hellomonkey.mp3')
133+
r.play(url='http://hellomonkey.mp3')
134134

135135
assert_equal(
136136
self.strip(r),
@@ -140,7 +140,7 @@ def test_play_hello(self):
140140
def test_play_hello_loop(self):
141141
""" should play hello monkey loop """
142142
r = VoiceResponse()
143-
r.play('http://hellomonkey.mp3', loop=3)
143+
r.play(url='http://hellomonkey.mp3', loop=3)
144144

145145
assert_equal(
146146
self.strip(r),
@@ -150,7 +150,7 @@ def test_play_hello_loop(self):
150150
def test_play_digits(self):
151151
""" should play digits """
152152
r = VoiceResponse()
153< 10000 /td>-
r.play('', digits='w123')
153+
r.play(digits='w123')
154154

155155
assert_equal(
156156
self.strip(r),
@@ -560,7 +560,7 @@ def test_nested_say_play_pause(self):
560560
""" a gather with a say, play, and pause """
561561
g = Gather()
562562
g.say('Hey')
563-
g.play('hey.mp3')
563+
g.play(url='hey.mp3')
564564
g.pause()
565565

566566
r = VoiceResponse()

twilio/twiml/voice_response.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def pause(self, length=None):
164164
return self.append(Pause(length=length))
165165

166166
def play(self,
167-
url,
167+
url=None,
168168
loop=None,
169169
digits=None,
170170
**kwargs):
@@ -178,7 +178,7 @@ def play(self,
178178
:return: <Play> element
179179
"""
180180
return self.append(Play(
181-
url,
181+
url=url,
182182
loop=loop,
183183
digits=digits,
184184
**kwargs
@@ -696,7 +696,7 @@ def say(self,
696696
))
697697

698698
def play(self,
699-
url,
699+
url=None,
700700
loop=None,
701701
digits=None,
702702
**kwargs):
@@ -710,7 +710,7 @@ def play(self,
710710
:return: <Play> element
711711
"""
712712
return self.append(Play(
713-
url,
713+
url=url,
714714
loop=loop,
715715
digits=digits,
716716
**kwargs
@@ -737,12 +737,12 @@ class Play(TwiML):
737737
"""
738738
<Play> element
739739
"""
740-
def __init__(self, url, **kwargs):
740+
def __init__(self, url=None, **kwargs):
741741
"""
742742
Create a new <Play> element
743743
744-
:param url: media URL
745-
:param kwargs: additional attributes
744+
:param url: optional media URL
745+
:param kwargs: attributes
746746
"""
747747
super(Play, self).__init__(**kwargs)
748748
self.value = url

0 commit comments

Comments
 (0)
0