Skip to content

Commit 494ad2c

Browse files
committed
update broken tests
1 parent 893c146 commit 494ad2c

16 files changed

+58
-45
lines changed

test/unit/models/test_call_transcription.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def make_instance(self, include_optional) -> CallTranscription:
3131
include_optional is a boolean, when False only required
3232
params are included, when True both required and
3333
optional params are included """
34-
instance = CallTranscription()
3534
if include_optional:
3635
return CallTranscription(
3736
detected_language = 'en-US',

test/unit/models/test_error_object.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import unittest
1717

1818
from bandwidth.models.error_object import ErrorObject
19+
from bandwidth.models.error_source import ErrorSource
1920

2021
class TestErrorObject(unittest.TestCase):
2122
"""ErrorObject unit test stubs"""
@@ -33,8 +34,14 @@ def make_instance(self, include_optional) -> ErrorObject:
3334
optional params are included """
3435
if include_optional:
3536
return ErrorObject(
36-
code = 'code',
37-
message = 'message'
37+
type = 'type',
38+
description = 'description',
39+
source = ErrorSource(
40+
parameter = 'parameter',
41+
var_field = 'var_field',
42+
header = 'header',
43+
reference = 'reference'
44+
)
3845
)
3946
else:
4047
return ErrorObject(
@@ -45,8 +52,13 @@ def testErrorObject(self):
4552
instance = self.make_instance(True)
4653
assert instance is not None
4754
assert isinstance(instance, ErrorObject)
48-
assert instance.code == 'code'
49-
assert instance.message == 'message'
55+
assert instance.type == 'type'
56+
assert instance.description == 'description'
57+
assert isinstance(instance.source, ErrorSource)
58+
assert instance.source.parameter == 'parameter'
59+
assert instance.source.var_field == 'var_field'
60+
assert instance.source.header == 'header'
61+
assert instance.source.reference == 'reference'
5062

5163
if __name__ == '__main__':
5264
unittest.main()

test/unit/models/test_mms_message_content.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import unittest
1717

1818
from bandwidth.models.mms_message_content import MmsMessageContent
19+
from bandwidth.models.mms_message_content_file import MmsMessageContentFile
1920

2021
class TestMmsMessageContent(unittest.TestCase):
2122
"""MmsMessageContent unit test stubs"""
@@ -34,7 +35,7 @@ def make_instance(self, include_optional) -> MmsMessageContent:
3435
if include_optional:
3536
return MmsMessageContent(
3637
text = 'Hello world',
37-
media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"]
38+
media = [MmsMessageContentFile(fileUrl="https://image.com/image.png")]
3839
)
3940
else:
4041
return MmsMessageContent(
@@ -46,7 +47,7 @@ def testMmsMessageContent(self):
4647
assert instance is not None
4748
assert isinstance(instance, MmsMessageContent)
4849
assert instance.text == 'Hello world'
49-
assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"]
50+
assert instance.media == [MmsMessageContentFile(fileUrl="https://image.com/image.png")]
5051

5152
if __name__ == '__main__':
5253
unittest.main()

test/unit/models/test_multi_channel_action.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,26 @@ def testMultiChannelAction(self):
4242
model_rbm_action_base = MultiChannelAction(RbmActionBase(
4343
type='REPLY',
4444
text='Hello world',
45-
post_back_data='[B@32298473'
45+
postback_data='[B@32298473'
4646
))
4747
model_rbm_action_dial = MultiChannelAction(RbmActionDial(
4848
type='DIAL_PHONE',
4949
text='Hello world',
50-
post_back_data='[B@32298473',
50+
postback_data='[B@32298473',
5151
phone_number='1234567890'
5252
))
5353
model_rbm_action_view_location = MultiChannelAction(RbmActionViewLocation(
5454
type='SHOW_LOCATION',
5555
text='Hello world',
56-
post_back_data='[B@32298473',
56+
postback_data='[B@32298473',
5757
latitude='37.7749',
5858
longitude='-122.4194',
5959
label='San Francisco'
6060
))
6161
model_multi_channel_action_calendar_event = MultiChannelAction(MultiChannelActionCalendarEvent(
6262
type = 'CREATE_CALENDAR_EVENT',
6363
text = 'Hello world',
64-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
64+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
6565
title = 'Meeting with John',
6666
start_time = '2022-09-14T18:20:16Z',
6767
end_time = '2022-09-14T18:20:16Z',
@@ -70,7 +70,7 @@ def testMultiChannelAction(self):
7070
model_rbm_action_open_url = MultiChannelAction(RbmActionOpenUrl(
7171
type='OPEN_URL',
7272
text='Hello world',
73-
post_back_data='[B@32298473',
73+
postback_data='[B@32298473',
7474
url='https://www.example.com'
7575
))
7676

test/unit/models/test_multi_channel_action_calendar_event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> MultiChannelActionCalendarEvent:
3636
return MultiChannelActionCalendarEvent(
3737
type = 'REPLY',
3838
text = 'Hello world',
39-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
39+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
4040
title = 'Meeting with John',
4141
start_time = '2022-09-14T18:20:16Z',
4242
end_time = '2022-09-14T18:20:16Z',
@@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> MultiChannelActionCalendarEvent:
4646
return MultiChannelActionCalendarEvent(
4747
type = 'REPLY',
4848
text = 'Hello world',
49-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
49+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
5050
title = 'Meeting with John',
5151
start_time = '2022-09-14T18:20:16Z',
5252
end_time = '2022-09-14T18:20:16Z',
@@ -59,7 +59,7 @@ def testMultiChannelActionCalendarEvent(self):
5959
assert isinstance(instance, MultiChannelActionCalendarEvent)
6060
assert instance.type == 'REPLY'
6161
assert instance.text == 'Hello world'
62-
assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
62+
assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
6363
assert instance.title == 'Meeting with John'
6464
assert isinstance(instance.start_time, datetime)
6565
assert isinstance(instance.end_time, datetime)

test/unit/models/test_multi_channel_channel_list_object_content.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from bandwidth.models.rbm_standalone_card import RbmStandaloneCard
2828
from bandwidth.models.rbm_card_content import RbmCardContent
2929
from bandwidth.models.rbm_message_content_file import RbmMessageContentFile
30+
from bandwidth.models.mms_message_content_file import MmsMessageContentFile
3031

3132

3233
class TestMultiChannelChannelListObjectContent(unittest.TestCase):
@@ -54,7 +55,7 @@ def testMultiChannelChannelListObjectContent(self):
5455
RbmActionBase(
5556
type = 'REPLY',
5657
text = 'Hello world',
57-
post_back_data = '[B@32298473'
58+
postback_data = '[B@32298473'
5859
)
5960
)
6061
]
@@ -82,7 +83,7 @@ def testMultiChannelChannelListObjectContent(self):
8283
RbmActionBase(
8384
type = 'REPLY',
8485
text = 'Hello world',
85-
post_back_data = '[B@32298473'
86+
postback_data = '[B@32298473'
8687
)
8788
)
8889
]
@@ -92,7 +93,7 @@ def testMultiChannelChannelListObjectContent(self):
9293
RbmActionBase(
9394
type = 'REPLY',
9495
text = 'Hello world',
95-
post_back_data = '[B@32298473'
96+
postback_data = '[B@32298473'
9697
)
9798
)
9899
]
@@ -103,7 +104,7 @@ def testMultiChannelChannelListObjectContent(self):
103104
))
104105
model_mms_message_content = MultiChannelChannelListObjectContent(MmsMessageContent(
105106
text = 'Hello world',
106-
media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"]
107+
media = [MmsMessageContentFile(fileUrl="https://image.com/image.png")]
107108
))
108109

109110
assert model_rbm_message_content_text is not None

test/unit/models/test_rbm_action_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def make_instance(self, include_optional) -> RbmActionBase:
3535
return RbmActionBase(
3636
type = 'REPLY',
3737
text = 'Hello world',
38-
post_back_data = '[B@32298473'
38+
postback_data = '[B@32298473'
3939
)
4040
else:
4141
return RbmActionBase(
4242
type = 'REPLY',
4343
text = 'Hello world',
44-
post_back_data = '[B@32298473',
44+
postback_data = '[B@32298473',
4545
)
4646

4747
def testRbmActionBase(self):
@@ -51,7 +51,7 @@ def testRbmActionBase(self):
5151
assert isinstance(instance, RbmActionBase)
5252
assert instance.type == 'REPLY'
5353
assert instance.text == 'Hello world'
54-
assert instance.post_back_data == '[B@32298473'
54+
assert instance.postback_data == '[B@32298473'
5555

5656
if __name__ == '__main__':
5757
unittest.main()

test/unit/models/test_rbm_action_dial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ def make_instance(self, include_optional) -> RbmActionDial:
3535
return RbmActionDial(
3636
type = 'REPLY',
3737
text = 'Hello world',
38-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
38+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
3939
phone_number = '+15552223333'
4040
)
4141
else:
4242
return RbmActionDial(
4343
type = 'REPLY',
4444
text = 'Hello world',
45-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
45+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
4646
phone_number = '+15552223333',
4747
)
4848

@@ -53,7 +53,7 @@ def testRbmActionDial(self):
5353
assert isinstance(instance, RbmActionDial)
5454
assert instance.type == 'REPLY'
5555
assert instance.text == 'Hello world'
56-
assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
56+
assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
5757
assert instance.phone_number == '+15552223333'
5858

5959
if __name__ == '__main__':

test/unit/models/test_rbm_action_open_url.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ def make_instance(self, include_optional) -> RbmActionOpenUrl:
3535
return RbmActionOpenUrl(
3636
type = 'REPLY',
3737
text = 'Hello world',
38-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
38+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
3939
url = 'https://dev.bandwidth.com'
4040
)
4141
else:
4242
return RbmActionOpenUrl(
4343
type = 'REPLY',
4444
text = 'Hello world',
45-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
45+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
4646
url = 'https://dev.bandwidth.com',
4747
)
4848

@@ -53,7 +53,7 @@ def testRbmActionOpenUrl(self):
5353
assert isinstance(instance, RbmActionOpenUrl)
5454
assert instance.type == 'REPLY'
5555
assert instance.text == 'Hello world'
56-
assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
56+
assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
5757
assert instance.url == 'https://dev.bandwidth.com'
5858

5959
if __name__ == '__main__':

test/unit/models/test_rbm_action_view_location.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> RbmActionViewLocation:
3535
return RbmActionViewLocation(
3636
type = 'REPLY',
3737
text = 'Hello world',
38-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
38+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
3939
latitude = '37.7749',
4040
longitude = '-122.4194',
4141
label = 'San Francisco'
@@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> RbmActionViewLocation:
4444
return RbmActionViewLocation(
4545
type = 'REPLY',
4646
text = 'Hello world',
47-
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
47+
postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
4848
latitude = '37.7749',
4949
longitude = '-122.4194',
5050
)
@@ -56,7 +56,7 @@ def testRbmActionViewLocation(self):
5656
assert isinstance(instance, RbmActionViewLocation)
5757
assert instance.type == 'REPLY'
5858
assert instance.text == 'Hello world'
59-
assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
59+
assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
6060
assert instance.latitude == '37.7749'
6161
assert instance.longitude == '-122.4194'
6262
assert instance.label == 'San Francisco'

0 commit comments

Comments
 (0)