Skip to content

Commit 6c7ff9c

Browse files
Fixed casing
1 parent 8fa977c commit 6c7ff9c

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

bandwidth/model/bxml/verbs/gather.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,18 @@ def __init__(
7171
@property
7272
def _attributes(self):
7373
return {
74-
"gather_url": self.gather_url,
75-
"gather_method": self.gather_method,
76-
"gather_fallback_url": self.gather_fallback_url,
77-
"gather_fallback_method": self.gather_fallback_method,
74+
"gatherUrl": self.gather_url,
75+
"gatherMethod": self.gather_method,
76+
"gatherFallbackUrl": self.gather_fallback_url,
77+
"gatherFallbackMethod": self.gather_fallback_method,
7878
"username": self.username,
7979
"password": self.password,
80-
"fallback_username": self.fallback_username,
81-
"fallback_password": self.fallback_password,
80+
"fallbackUsername": self.fallback_username,
81+
"fallbackPassword": self.fallback_password,
8282
"tag": self.tag,
83-
"terminating_digits": self.terminating_digits,
84-
"max_digits": self.max_digits,
85-
"inter_digit_timeout": self.inter_digit_timeout,
86-
"first_digit_timeout": self.first_digit_timeout,
87-
"repeat_count": self.repeat_count,
83+
"terminatingDigits": self.terminating_digits,
84+
"maxDigits": self.max_digits,
85+
"interDigitTimeout": self.inter_digit_timeout,
86+
"firstDigitTimeout": self.first_digit_timeout,
87+
"repeatCount": self.repeat_count,
8888
}
89-
self.attributes = {
90-
91-
}
92-
93-
super().__init__(tag="Gather", content=None, attributes=self.attributes, nested_verbs=self.audio_verbs)

test/unit/bxml/test_gather.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ def setUp(self):
4545

4646
def test_to_bxml(self):
4747
if os.environ['PYTHON_VERSION'] == '3.7':
48-
expected = '<Gather fallback_password="pass" fallback_username="user" first_digit_timeout="3" gather_url="test.com" gather_method="POST" gather_fallback_url="fallback-test.com" gather_fallback_method="GET" inter_digit_timeout="1" password="pass" max_digits="5"><PlayAudio password="pass" username="user">https://audio.url/audio1.wav</PlayAudio> repeat_count="2" tag="tag" terminating_digits="2" username="user"</Gather>'
48+
expected = '<Gather fallbackPassword="pass" fallbackUsername="user" firstDigitTimeout="3" gatherUrl="test.com" gatherMethod="POST" gatherFallback_url="fallback-test.com" gatherFallbackMethod="GET" interDigitTimeout="1" password="pass" maxDigits="5"><PlayAudio password="pass" username="user">https://audio.url/audio1.wav</PlayAudio> repeatCount="2" tag="tag" terminatingDigits="2" username="user"</Gather>'
4949
else:
50-
expected = '<Gather gather_url="test.com" gather_method="POST" gather_fallback_url="fallback-test.com" gather_fallback_method="GET" username="user" password="pass" fallback_username="user" fallback_password="pass" tag="tag" terminating_digits="2" max_digits="5" inter_digit_timeout="1" first_digit_timeout="3" repeat_count="2"><PlayAudio username="user" password="pass">https://audio.url/audio1.wav</PlayAudio></Gather>'
50+
expected = '<Gather gatherUrl="test.com" gatherMethod="POST" gatherFallbackUrl="fallback-test.com" gatherFallbackMethod="GET" username="user" password="pass" fallbackUsername="user" fallbackPassword="pass" tag="tag" terminatingDigits="2" maxDigits="5" interDigitTimeout="1" firstDigitTimeout="3" repeatCount="2"><PlayAudio username="user" password="pass">https://audio.url/audio1.wav</PlayAudio></Gather>'
5151
assert(expected == self.gather.to_bxml())
5252

5353
def test_add_verb(self):
5454
if os.environ['PYTHON_VERSION'] == '3.7':
55-
expected = '<Gather fallback_password="pass" fallback_username="user" first_digit_timeout="3" gather_url="test.com" gather_method="POST" gather_fallback_url="fallback-test.com" gather_fallback_method="GET" inter_digit_timeout="1" password="pass" max_digits="5"><PlayAudio password="pass" username="user">https://audio.url/audio1.wav</PlayAudio> repeat_count="2" <SpeakSentence>Hello. Your number is &lt;say-as interpret-as="telephone"&gt;asdf&lt;/say-as&gt;, lets play a game. What is 10 + 3. Press the pound key when finished.</SpeakSentence> tag="tag" terminating_digits="2" username="user"</Gather>'
55+
expected = '<Gather fallbackPassword="pass" fallbackUsername="user" firstDigitTimeout="3" gatherUrl="test.com" gatherMethod="POST" gatherFallbackUrl="fallback-test.com" gatherFallbackMethod="GET" interDigitTimeout="1" password="pass" maxDigits="5"><PlayAudio password="pass" username="user">https://audio.url/audio1.wav</PlayAudio> repeatCount="2" <SpeakSentence>Hello. Your number is &lt;say-as interpret-as="telephone"&gt;asdf&lt;/say-as&gt;, lets play a game. What is 10 + 3. Press the pound key when finished.</SpeakSentence> tag="tag" terminatingDigits="2" username="user"</Gather>'
5656
else:
57-
expected = '<Gather gather_url="test.com" gather_method="POST" gather_fallback_url="fallback-test.com" gather_fallback_method="GET" username="user" password="pass" fallback_username="user" fallback_password="pass" tag="tag" terminating_digits="2" max_digits="5" inter_digit_timeout="1" first_digit_timeout="3" repeat_count="2"><PlayAudio username="user" password="pass">https://audio.url/audio1.wav</PlayAudio><SpeakSentence>Hello. Your number is &lt;say-as interpret-as="telephone"&gt;asdf&lt;/say-as&gt;, lets play a game. What is 10 + 3. Press the pound key when finished.</SpeakSentence></Gather>'
57+
expected = '<Gather gatherUrl="test.com" gatherMethod="POST" gatherFallbackUrl="fallback-test.com" gatherFallbackMethod="GET" username="user" password="pass" fallbackUsername="user" fallbackPassword="pass" tag="tag" terminatingDigits="2" maxDigits="5" interDigitTimeout="1" firstDigitTimeout="3" repeatCount="2"><PlayAudio username="user" password="pass">https://audio.url/audio1.wav</PlayAudio><SpeakSentence>Hello. Your number is &lt;say-as interpret-as="telephone"&gt;asdf&lt;/say-as&gt;, lets play a game. What is 10 + 3. Press the pound key when finished.</SpeakSentence></Gather>'
5858
self.gather.add_verb(self.speak_sentence)
5959
assert(expected == self.gather.to_bxml())

0 commit comments

Comments
 (0)