Skip to content

Commit 6ebc80d

Browse files
Refactored due to change in attribute constructor
1 parent c16b4b1 commit 6ebc80d

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

bandwidth/model/bxml/verbs/forward.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,21 @@ def __init__(
4646
Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed.
4747
This value, including the encoding specifier, may not exceed 256 characters.
4848
"""
49-
self.attributes = {
50-
"to": to,
51-
"from_": from_,
52-
"call_timeout": call_timeout,
53-
"diversion_treatment": diversion_treatment,
54-
"diversion_reason": diversion_reason,
55-
"uui": uui,
56-
}
57-
58-
super().__init__(tag="Forward", content=None, attributes=self.attributes)
49+
self.to = to
50+
self.from_ = from_
51+
self.call_timeout = call_timeout
52+
self.diversion_treatment = diversion_treatment
53+
self.diversion_reason = diversion_reason
54+
self.uui = uui
55+
56+
super().__init__(tag="Forward", content=None)
57+
@property
58+
def _attributes(self):
59+
return {
60+
"to": self.to,
61+
"from_": self.from_,
62+
"call_timeout": self.call_timeout,
63+
"diversion_treatment": self.diversion_treatment,
64+
"diversion_reason": self.diversion_reason,
65+
"uui": self.uui,
66+
}

test/unit/bxml/test_forward.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pytest
1010
import unittest
1111

12+
from bandwidth.model.bxml.verb import Verb
1213
from bandwidth.model.bxml.verbs.forward import Forward
1314

1415
class TestForward(unittest.TestCase):
@@ -22,6 +23,8 @@ def setUp(self):
2223
diversion_reason="away",
2324
uui="93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt"
2425
)
26+
self.test_verb = Verb(tag="test")
27+
2528

2629
def test_to_bxml(self):
2730
if os.environ['PYTHON_VERSION'] == '3.7':

0 commit comments

Comments
 (0)