-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2758637
commit 00e4016
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
test_start_transcription.py | ||
Unit tests for the <StartTranscription> BXML verb | ||
@copyright Bandwidth Inc. | ||
""" | ||
import unittest | ||
|
||
from bandwidth.models.bxml import StartTranscription, CustomParam | ||
|
||
|
||
class TestStartTranscription(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.custom_param1 = CustomParam( | ||
name="name1", | ||
value="value1" | ||
) | ||
|
||
self.custom_param2 = CustomParam( | ||
name="name2", | ||
value="value2" | ||
) | ||
|
||
self.start_transcription = StartTranscription( | ||
name="transcription1", | ||
tracks="both", | ||
transcription_event_url="eventurl.com", | ||
transcription_event_method="POST", | ||
username="user", | ||
password="pass", | ||
destination="testurl.com", | ||
stabilized=True, | ||
custom_params=[self.custom_param1] | ||
) | ||
|
||
def test_to_bxml(self): | ||
expected = '<StartTranscription destination="testurl.com" name="transcription1" tracks="both" transcriptionEventUrl="eventurl.com" transcriptionEventMethod="POST" username="user" password="pass" stabilized="true"><CustomParam name="name1" value="value1" /></StartTranscription>' | ||
assert(expected == self.start_transcription.to_bxml()) | ||
|
||
def test_add_verb(self): | ||
expected = '<StartTranscription destination="testurl.com" name="transcription1" tracks="both" transcriptionEventUrl="eventurl.com" transcriptionEventMethod="POST" username="user" password="pass" stabilized="true"><CustomParam name="name1" value="value1" /><CustomParam name="name2" value="value2" /></StartTranscription>' | ||
self.start_transcription.add_verb(self.custom_param2) | ||
assert(expected == self.start_transcription.to_bxml()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
test_stop_transcription.py | ||
Unit tests for the <StopTranscription> BXML verb | ||
@copyright Bandwidth Inc. | ||
""" | ||
import unittest | ||
|
||
from bandwidth.models.bxml import StopTranscription | ||
|
||
|
||
class TestStopTranscription(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.stop_transcription = StopTranscription( | ||
name="transcription1" | ||
) | ||
|
||
def test_to_bxml(self): | ||
expected = '<StopTranscription name="transcription1" />' | ||
assert(expected == StopTranscription().to_bxml()) |