8000 Allow adding text to TwiML nodes by ekarson · Pull Request #422 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

Allow adding text to TwiML nodes #422

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

Merged
merged 3 commits into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add test for voice
  • Loading branch information
Ethan Karson committed Jun 8, 2018
commit 1577af2713563c543010caa14b8a0aa9fda11e75
2 changes: 1 addition & 1 deletion tests/unit/twiml/test_messaging_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_redirect(self):
'<?xml version="1.0" encoding="UTF-8"?><Response><Redirect>example.com</Redirect></Response>'
)

class TestTest(TwilioTest):
class TestText(TwilioTest):
def test_text(self):
r = MessagingResponse()
r.append('No tags!')
Expand Down
21 changes: 21 additions & 0 deletions tests/unit/twiml/test_voice_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,3 +602,24 @@ def test_nested_say_play_pause(self):
self.strip(r),
'<?xml version="1.0" encoding="UTF-8"?><Response><Gather><Say>Hey</Say><Play>hey.mp3</Play><Pause /></Gather></Response>'
)

class TestText(TwilioTest):
def test_text(self):
r = VoiceResponse()
r.append('No tags!')

assert_equal(
self.strip(r),
'<?xml version="1.0" encoding="UTF-8"?><Response>No tags!</Response>'
)

def text_mixed(self):
r = VoiceResponse()
r.append('before')
r.say('Content')
r.append('after')

assert_equal(
self.strip(r),
'<?xml version="1.0" encoding="UTF-8"?><Response>before<Say>Content</Say>after</Response>'
)
0