From 00e4016f25aa5f20e89bb780ea4046e2c18d463f Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:24:03 -0500 Subject: [PATCH] Add unit tests --- bandwidth/models/bxml/verbs/__init__.py | 3 ++ test/unit/bxml/test_start_transcription.py | 44 ++++++++++++++++++++++ test/unit/bxml/test_stop_transcription.py | 21 +++++++++++ 3 files changed, 68 insertions(+) create mode 100644 test/unit/bxml/test_start_transcription.py create mode 100644 test/unit/bxml/test_stop_transcription.py diff --git a/bandwidth/models/bxml/verbs/__init__.py b/bandwidth/models/bxml/verbs/__init__.py index 1a4c87c6..fc6ce38b 100644 --- a/bandwidth/models/bxml/verbs/__init__.py +++ b/bandwidth/models/bxml/verbs/__init__.py @@ -1,5 +1,6 @@ from .bridge import Bridge from .conference import Conference +from .custom_param import CustomParam from .hangup import Hangup from .gather import Gather from .pause import Pause @@ -16,9 +17,11 @@ from .start_gather import StartGather from .start_recording import StartRecording from .start_stream import StartStream +from .start_transcription import StartTranscription from .stop_gather import StopGather from .stop_stream import StopStream from .stop_recording import StopRecording +from .stop_transcription import StopTranscription from .stream_param import StreamParam from .tag import Tag from .transfer import Transfer diff --git a/test/unit/bxml/test_start_transcription.py b/test/unit/bxml/test_start_transcription.py new file mode 100644 index 00000000..b1a969cb --- /dev/null +++ b/test/unit/bxml/test_start_transcription.py @@ -0,0 +1,44 @@ +""" +test_start_transcription.py + +Unit tests for the 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 = '' + assert(expected == self.start_transcription.to_bxml()) + + def test_add_verb(self): + expected = '' + self.start_transcription.add_verb(self.custom_param2) + assert(expected == self.start_transcription.to_bxml()) diff --git a/test/unit/bxml/test_stop_transcription.py b/test/unit/bxml/test_stop_transcription.py new file mode 100644 index 00000000..1ba19e6f --- /dev/null +++ b/test/unit/bxml/test_stop_transcription.py @@ -0,0 +1,21 @@ +""" +test_stop_transcription.py + +Unit tests for the 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 = '' + assert(expected == StopTranscription().to_bxml())