File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
bandwidth/model/bxml/verbs Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 11from .bridge import Bridge
2+ from .pause import Pause
23from .hangup import Hangup
34from .gather import Gather
45from .phone_number import PhoneNumber
Original file line number Diff line number Diff line change 1+ """
2+ pause.py
3+ Bandwidth's Pause BXML verb
4+ @copyright Bandwidth INC
5+ """
6+ from ..terminal_verb import TerminalVerb
7+ class Pause (TerminalVerb ):
8+ def __init__ (self , duration :str = None ):
9+ """Initialize a <Pause> verb
10+ Args:
11+ duration (str, optional): The time in seconds to pause. Default value is 1.
12+ """
13+ self .duration = duration
14+
15+ super ().__init__ (tag = "Pause" , content = None )
16+ @property
17+ def _attributes (self ):
18+ return {
19+ "duration" : self .duration
20+ }
Original file line number Diff line number Diff line change 1+ """
2+ test_Pause.py
3+
4+ Unit tests for the <Pause> BXML verb
5+
6+ @copyright Bandwidth Inc.
7+ """
8+ import pytest
9+ import unittest
10+ from bandwidth .model .bxml .verb import Verb
11+ from bandwidth .model .bxml .verbs .pause import Pause
12+
13+ class TestPause (unittest .TestCase ):
14+
15+ def setUp (self ):
16+ self .pause = Pause (duration = "30" )
17+ self .test_verb = Verb (tag = "test" )
18+
19+ def test_to_bxml (self ):
20+ expected = '<Pause duration="30" />'
21+ assert (expected == self .pause .to_bxml ())
22+
23+ def test_add_verb (self ):
24+ with pytest .raises (AttributeError ):
25+ self .pause .add_verb (self .test_verb )
You can’t perform that action at this time.
0 commit comments