Skip to content

Commit 4eb2bb3

Browse files
committed
model unit tests
1 parent 2408a9f commit 4eb2bb3

22 files changed

+1513
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
import unittest
17+
18+
from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse
19+
from bandwidth.models.link import Link
20+
from bandwidth.models.multi_channel_message_data import MultiChannelMessageData
21+
from bandwidth.models.error_object import ErrorObject
22+
23+
class TestCreateMultiChannelMessageResponse(unittest.TestCase):
24+
"""CreateMultiChannelMessageResponse unit test stubs"""
25+
26+
def setUp(self):
27+
pass
28+
29+
def tearDown(self):
30+
pass
31+
32+
def make_instance(self, include_optional) -> CreateMultiChannelMessageResponse:
33+
"""Test CreateMultiChannelMessageResponse
34+
include_optional is a boolean, when False only required
35+
params are included, when True both required and
36+
optional params are included """
37+
if include_optional:
38+
return CreateMultiChannelMessageResponse(
39+
links = [
40+
Link(
41+
rel = 'rel',
42+
href = 'href', )
43+
],
44+
data = MultiChannelMessageData(
45+
message_id = '1589228074636lm4k2je7j7jklbn2',
46+
status = 'DELIVERED',
47+
time = '2025-01-01T18:20:16Z',
48+
direction = 'OUTBOUND',
49+
var_from = 'BandwidthRBM',
50+
to = '+15552223333',
51+
application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
52+
channel = 'RBM',
53+
tag = 'custom string', ),
54+
errors = [
55+
ErrorObject(
56+
code = 'code',
57+
message = 'message', )
58+
]
59+
)
60+
else:
61+
return CreateMultiChannelMessageResponse(
62+
)
63+
64+
def testCreateMultiChannelMessageResponse(self):
65+
"""Test CreateMultiChannelMessageResponse"""
66+
instance = self.make_instance(True)
67+
assert instance is not None
68+
assert isinstance(instance, CreateMultiChannelMessageResponse)
69+
assert isinstance(instance.links, list)
70+
assert isinstance(instance.data, MultiChannelMessageData)
71+
assert isinstance(instance.errors, list)
72+
assert isinstance(instance.links[0], Link)
73+
assert isinstance(instance.data, MultiChannelMessageData)
74+
assert isinstance(instance.errors[0], ErrorObject)
75+
assert instance.data.message_id == '1589228074636lm4k2je7j7jklbn2'
76+
assert instance.data.status == 'DELIVERED'
77+
assert instance.data.direction == 'OUTBOUND'
78+
assert instance.data.var_from == 'BandwidthRBM'
79+
assert instance.data.to == '+15552223333'
80+
assert instance.data.application_id == '93de2206-9669-4e07-948d-329f4b722ee2'
81+
assert instance.data.channel == 'RBM'
82+
assert instance.data.tag == 'custom string'
83+
assert instance.errors[0].code == 'code'
84+
assert instance.errors[0].message == 'message'
85+
assert instance.links[0].rel == 'rel'
86+
assert instance.links[0].href == 'href'
87+
88+
89+
if __name__ == '__main__':
90+
unittest.main()
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
import unittest
17+
18+
from bandwidth.models.error_object import ErrorObject
19+
20+
class TestErrorObject(unittest.TestCase):
21+
"""ErrorObject unit test stubs"""
22+
23+
def setUp(self):
24+
pass
25+
26+
def tearDown(self):
27+
pass
28+
29+
def make_instance(self, include_optional) -> ErrorObject:
30+
"""Test ErrorObject
31+
include_optional is a boolean, when False only required
32+
params are included, when True both required and
33+
optional params are included """
34+
if include_optional:
35+
return ErrorObject(
36+
code = 'code',
37+
message = 'message'
38+
)
39+
else:
40+
return ErrorObject(
41+
)
42+
43+
def testErrorObject(self):
44+
"""Test ErrorObject"""
45+
instance = self.make_instance(True)
46+
assert instance is not None
47+
assert isinstance(instance, ErrorObject)
48+
assert instance.code == 'code'
49+
assert instance.message == 'message'
50+
51+
if __name__ == '__main__':
52+
unittest.main()

test/unit/models/test_link.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
import unittest
17+
18+
from bandwidth.models.link import Link
19+
20+
class TestLink(unittest.TestCase):
21+
"""Link unit test stubs"""
22+
23+
def setUp(self):
24+
pass
25+
26+
def tearDown(self):
27+
pass
28+
29+
def make_instance(self, include_optional) -> Link:
30+
"""Test Link
31+
include_optional is a boolean, when False only required
32+
params are included, when True both required and
33+
optional params are included """
34+
if include_optional:
35+
return Link(
36+
rel = 'rel',
37+
href = 'href'
38+
)
39+
else:
40+
return Link(
41+
)
42+
43+
def testLink(self):
44+
"""Test Link"""
45+
instance = self.make_instance(True)
46+
assert instance is not None
47+
assert isinstance(instance, Link)
48+
assert instance.rel == 'rel'
49+
assert instance.href == 'href'
50+
51+
if __name__ == '__main__':
52+
unittest.main()
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
import unittest
17+
18+
from bandwidth.models.mms_message_content import MmsMessageContent
19+
20+
class TestMmsMessageContent(unittest.TestCase):
21+
"""MmsMessageContent unit test stubs"""
22+
23+
def setUp(self):
24+
pass
25+
26+
def tearDown(self):
27+
pass
28+
29+
def make_instance(self, include_optional) -> MmsMessageContent:
30+
"""Test MmsMessageContent
31+
include_optional is a boolean, when False only required
32+
params are included, when True both required and
33+
optional params are included """
34+
if include_optional:
35+
return MmsMessageContent(
36+
text = 'Hello world',
37+
media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"]
38+
)
39+
else:
40+
return MmsMessageContent(
41+
)
42+
43+
def testMmsMessageContent(self):
44+
"""Test MmsMessageContent"""
45+
instance = self.make_instance(True)
46+
assert instance is not None
47+
assert isinstance(instance, MmsMessageContent)
48+
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+
51+
if __name__ == '__main__':
52+
unittest.main()
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
import unittest
17+
from datetime import datetime
18+
19+
from bandwidth.models.multi_channel_action_calendar_event import MultiChannelActionCalendarEvent
20+
21+
class TestMultiChannelActionCalendarEvent(unittest.TestCase):
22+
"""MultiChannelActionCalendarEvent unit test stubs"""
23+
24+
def setUp(self):
25+
pass
26+
27+
def tearDown(self):
28+
pass
29+
30+
def make_instance(self, include_optional) -> MultiChannelActionCalendarEvent:
31+
"""Test MultiChannelActionCalendarEvent
32+
include_optional is a boolean, when False only required
33+
params are included, when True both required and
34+
optional params are included """
35+
if include_optional:
36+
return MultiChannelActionCalendarEvent(
37+
type = 'REPLY',
38+
text = 'Hello world',
39+
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
40+
title = 'Meeting with John',
41+
start_time = '2022-09-14T18:20:16Z',
42+
end_time = '2022-09-14T18:20:16Z',
43+
description = 'Discuss the new project'
44+
)
45+
else:
46+
return MultiChannelActionCalendarEvent(
47+
type = 'REPLY',
48+
text = 'Hello world',
49+
post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==',
50+
title = 'Meeting with John',
51+
start_time = '2022-09-14T18:20:16Z',
52+
end_time = '2022-09-14T18:20:16Z',
53+
)
54+
55+
def testMultiChannelActionCalendarEvent(self):
56+
"""Test MultiChannelActionCalendarEvent"""
57+
instance = self.make_instance(True)
58+
assert instance is not None
59+
assert isinstance(instance, MultiChannelActionCalendarEvent)
60+
assert instance.type == 'REPLY'
61+
assert instance.text == 'Hello world'
62+
assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ=='
63+
assert instance.title == 'Meeting with John'
64+
assert isinstance(instance.start_time, datetime)
65+
assert isinstance(instance.end_time, datetime)
66+
67+
if __name__ == '__main__':
68+
unittest.main()
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# coding: utf-8
2+
3+
"""
4+
Bandwidth
5+
6+
Bandwidth's Communication APIs
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
import unittest
17+
from datetime import datetime
18+
19+
from bandwidth.models.multi_channel_callback_data import MultiChannelCallbackData
20+
from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData
21+
22+
class TestMultiChannelCallbackData(unittest.TestCase):
23+
"""MultiChannelCallbackData unit test stubs"""
24+
25+
def setUp(self):
26+
pass
27+
28+
def tearDown(self):
29+
pass
30+
31+
def make_instance(self, include_optional) -> MultiChannelCallbackData:
32+
"""Test MultiChannelCallbackData
33+
include_optional is a boolean, when False only required
34+
params are included, when True both required and
35+
optional params are included """
36+
if include_optional:
37+
return MultiChannelCallbackData(
38+
time = '2025-01-01T18:20:16Z',
39+
type = 'DELIVERED',
40+
to = '+15552223333',
41+
description = 'Incoming message received',
42+
message = MultiChannelMessageCallbackData(
43+
message_id = '1589228074636lm4k2je7j7jklbn2',
44+
status = 'DELIVERED',
45+
direction = 'OUTBOUND',
46+
var_from = 'BandwidthRBM',
47+
to = '+15552223333',
48+
application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
49+
channel = 'RBM',
50+
tag = 'custom string', )
51+
)
52+
else:
53+
return MultiChannelCallbackData(
54+
)
55+
56+
def testMultiChannelCallbackData(self):
57+
"""Test MultiChannelCallbackData"""
58+
instance = self.make_instance(True)
59+
assert instance is not None
60+
assert isinstance(instance, MultiChannelCallbackData)
61+
assert isinstance(instance.message, MultiChannelMessageCallbackData)
62+
assert isinstance(instance.time, datetime)
63+
assert instance.type == 'DELIVERED'
64+
assert instance.to == '+15552223333'
65+
assert instance.description == 'Incoming message received'
66+
assert instance.message.message_id == '1589228074636lm4k2je7j7jklbn2'
67+
assert instance.message.status == 'DELIVERED'
68+
assert instance.message.direction == 'OUTBOUND'
69+
assert instance.message.var_from == 'BandwidthRBM'
70+
assert instance.message.to == '+15552223333'
71+
assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2'
72+
assert instance.message.channel == 'RBM'
73+
assert instance.message.tag == 'custom string'
74+
75+
if __name__ == '__main__':
76+
unittest.main()

0 commit comments

Comments
 (0)