From eefd4d8d6b3b45dea32f5ead1b22119b99b79c68 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 3 Oct 2022 13:58:35 -0400 Subject: [PATCH] DX-2915 StopRecording Refactor --- bandwidth/model/bxml/verbs/__init__.py | 1 + bandwidth/model/bxml/verbs/stop_recording.py | 19 ++++++++++++++ test/unit/bxml/test_stop_recording.py | 27 ++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 bandwidth/model/bxml/verbs/stop_recording.py create mode 100644 test/unit/bxml/test_stop_recording.py diff --git a/bandwidth/model/bxml/verbs/__init__.py b/bandwidth/model/bxml/verbs/__init__.py index 08a9326a..b6254e39 100644 --- a/bandwidth/model/bxml/verbs/__init__.py +++ b/bandwidth/model/bxml/verbs/__init__.py @@ -2,5 +2,6 @@ from .phone_number import PhoneNumber from .record import Record from .sip_uri import SipUri +from .stop_recording import StopRecording from .tag import Tag from .transfer import Transfer diff --git a/bandwidth/model/bxml/verbs/stop_recording.py b/bandwidth/model/bxml/verbs/stop_recording.py new file mode 100644 index 00000000..611db0d2 --- /dev/null +++ b/bandwidth/model/bxml/verbs/stop_recording.py @@ -0,0 +1,19 @@ +""" +record.py + +Bandwidth's StopRecording BXML verb + +@copyright Bandwidth INC +""" +from ..terminal_verb import TerminalVerb + + +class StopRecording(TerminalVerb): + + def __init__(self): + """Initialize a verb + + Args: There are no args or text content for StopRecording + """ + + super().__init__(tag="StopRecording", content=None) diff --git a/test/unit/bxml/test_stop_recording.py b/test/unit/bxml/test_stop_recording.py new file mode 100644 index 00000000..c07ec531 --- /dev/null +++ b/test/unit/bxml/test_stop_recording.py @@ -0,0 +1,27 @@ +""" +test_stop_recording.py + +Unit tests for the BXML verb + +@copyright Bandwidth Inc. +""" +import pytest +import unittest + +from bandwidth.model.bxml.verb import Verb +from bandwidth.model.bxml.verbs.stop_recording import StopRecording + + +class TestTag(unittest.TestCase): + + def setUp(self): + self.stop_recording = StopRecording() + self.test_verb = Verb(tag="test") + + def test_to_bxml(self): + expected = '' + assert(expected == self.stop_recording.to_bxml()) + + def test_add_verb(self): + with pytest.raises(AttributeError): + self.stop_recording.add_verb(self.test_verb)