Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion bandwidth/model/bxml/terminal_verb.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ def add_verb(self, verb: Verb):
verb (Verb): BXML verb

Raises:
AttributeError: This method is not allowed for <SipUri>
AttributeError: This method is not allowed for this verb
"""
raise AttributeError('Adding verbs is not supported by this verb')
1 change: 1 addition & 0 deletions bandwidth/model/bxml/verbs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .bridge import Bridge
from .hangup import Hangup
from .gather import Gather
from .phone_number import PhoneNumber
from .play_audio import PlayAudio
Expand Down
19 changes: 19 additions & 0 deletions bandwidth/model/bxml/verbs/hangup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
hangup.py

Bandwidth's Hangup BXML verb

@copyright Bandwidth INC
"""
from ..terminal_verb import TerminalVerb


class Hangup(TerminalVerb):

def __init__(self):
"""Initialize a <Hangup> verb

Args:
None
"""
super().__init__(tag="Hangup", content=None)
28 changes: 28 additions & 0 deletions test/unit/bxml/test_hangup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
test_hangup.py

Unit tests for the <Hangup> BXML verb

@copyright Bandwidth Inc.
"""
import pytest
import unittest

from bandwidth.model.bxml.verb import Verb
from bandwidth.model.bxml.verbs.hangup import Hangup


class TestHangup(unittest.TestCase):

def setUp(self):
self.hangup = Hangup()
self.test_verb = Verb(tag="test")

def test_to_bxml(self):
expected = '<Hangup />'
assert(expected == self.hangup.to_bxml())

def test_add_verb(self):
with pytest.raises(AttributeError):
self.hangup.add_verb(self.test_verb)