Skip to content

Commit d09b573

Browse files
Refactored attribute construction for update
1 parent ac9700d commit d09b573

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bandwidth/model/bxml/verbs/pause.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ def __init__(self, duration:str=None):
1010
Args:
1111
duration (str, optional): The time in seconds to pause. Default value is 1.
1212
"""
13-
self.attributes = {
14-
"duration": duration
15-
}
13+
self.duration = duration
1614

17-
super().__init__(tag="Pause", content=None, attributes=self.attributes)
15+
super().__init__(tag="Pause", content=None)
16+
@property
17+
def _attributes(self):
18+
return {
19+
"duration": self.duration
20+
}

test/unit/bxml/test_pause.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
"""
88
import pytest
99
import unittest
10-
10+
from bandwidth.model.bxml.verb import Verb
1111
from bandwidth.model.bxml.verbs.pause import Pause
1212

1313
class TestPause(unittest.TestCase):
1414

1515
def setUp(self):
1616
self.pause = Pause(duration="30")
17+
self.test_verb = Verb(tag="test")
1718

1819
def test_to_bxml(self):
1920
expected = '<Pause duration="30" />'

0 commit comments

Comments
 (0)