Skip to content

Commit 4e9a4fe

Browse files
committed
unit tests for models
1 parent 32e37fe commit 4e9a4fe

19 files changed

+1154
-19
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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.async_lookup_request import AsyncLookupRequest
19+
20+
class TestAsyncLookupRequest(unittest.TestCase):
21+
"""AsyncLookupRequest 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) -> AsyncLookupRequest:
30+
"""Test AsyncLookupRequest
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 AsyncLookupRequest(
36+
phone_numbers = [
37+
'+680728880015'
38+
]
39+
)
40+
else:
41+
return AsyncLookupRequest(
42+
phone_numbers = [
43+
'+680728880015'
44+
],
45+
)
46+
47+
def testAsyncLookupRequest(self):
48+
"""Test AsyncLookupRequest"""
49+
instance = self.make_instance(True)
50+
assert instance is not None
51+
assert isinstance(instance, AsyncLookupRequest)
52+
assert instance.phone_numbers == ['+680728880015']
53+
54+
if __name__ == '__main__':
55+
unittest.main()
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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.completed_lookup_status_enum import CompletedLookupStatusEnum
19+
20+
class TestCompletedLookupStatusEnum(unittest.TestCase):
21+
"""CompletedLookupStatusEnum unit test stubs"""
22+
23+
def setUp(self):
24+
pass
25+
26+
def tearDown(self):
27+
pass
28+
29+
def testCompletedLookupStatusEnum(self):
30+
"""Test CompletedLookupStatusEnum"""
31+
assert CompletedLookupStatusEnum('COMPLETE') == 'COMPLETE'
32+
assert CompletedLookupStatusEnum('PARTIAL_COMPLETE') == 'PARTIAL_COMPLETE'
33+
assert CompletedLookupStatusEnum('FAILED') == 'FAILED'
34+
35+
if __name__ == '__main__':
36+
unittest.main()
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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_async_bulk_lookup_response import CreateAsyncBulkLookupResponse
19+
from bandwidth.models.create_async_bulk_lookup_response_data import CreateAsyncBulkLookupResponseData
20+
from bandwidth.models.link_schema import LinkSchema
21+
from bandwidth.models.lookup_error_schema import LookupErrorSchema
22+
from bandwidth.models.lookup_error_schema_meta import LookupErrorSchemaMeta
23+
from bandwidth.models.in_progress_lookup_status_enum import InProgressLookupStatusEnum
24+
25+
class TestCreateAsyncBulkLookupResponse(unittest.TestCase):
26+
"""CreateAsyncBulkLookupResponse unit test stubs"""
27+
28+
def setUp(self):
29+
pass
30+
31+
def tearDown(self):
32+
pass
33+
34+
def make_instance(self, include_optional) -> CreateAsyncBulkLookupResponse:
35+
"""Test CreateAsyncBulkLookupResponse
36+
include_optional is a boolean, when False only required
37+
params are included, when True both required and
38+
optional params are included """
39+
if include_optional:
40+
return CreateAsyncBulkLookupResponse(
41+
links = [
42+
LinkSchema(
43+
href = '/relative/uri',
44+
rel = 'aRelatedResource',
45+
method = 'GET', )
46+
],
47+
data = CreateAsyncBulkLookupResponseData(
48+
request_id = '004223a0-8b17-41b1-bf81-20732adf5590',
49+
status = InProgressLookupStatusEnum('COMPLETE'), ),
50+
errors = [
51+
LookupErrorSchema(
52+
code = 'NO-MATCH',
53+
description = 'Example error description',
54+
type = 'NumberInventory',
55+
meta = LookupErrorSchemaMeta(
56+
phone_numbers = ["+13992077164","+19196104424"],
57+
message = 'Invalid TNs',
58+
code = 1001, ), )
59+
]
60+
)
61+
else:
62+
return CreateAsyncBulkLookupResponse(
63+
)
64+
65+
def testCreateAsyncBulkLookupResponse(self):
66+
"""Test CreateAsyncBulkLookupResponse"""
67+
instance = self.make_instance(True)
68+
assert instance is not None
69+
assert isinstance(instance, CreateAsyncBulkLookupResponse)
70+
assert instance.links is not None
71+
assert isinstance(instance.links[0], LinkSchema)
72+
assert instance.links[0].href == '/relative/uri'
73+
assert instance.links[0].rel == 'aRelatedResource'
74+
assert instance.links[0].method == 'GET'
75+
assert instance.data is not None
76+
assert isinstance(instance.data, CreateAsyncBulkLookupResponseData)
77+
assert instance.data.request_id == '004223a0-8b17-41b1-bf81-20732adf5590'
78+
assert instance.data.status == InProgressLookupStatusEnum('COMPLETE')
79+
assert instance.errors is not None
80+
assert isinstance(instance.errors[0], LookupErrorSchema)
81+
assert instance.errors[0].code == 'NO-MATCH'
82+
assert instance.errors[0].description == 'Example error description'
83+
assert instance.errors[0].type == 'NumberInventory'
84+
assert instance.errors[0].meta is not None
85+
assert isinstance(instance.errors[0].meta, LookupErrorSchemaMeta)
86+
assert instance.errors[0].meta.phone_numbers == ["+13992077164","+19196104424"]
87+
assert instance.errors[0].meta.message == 'Invalid TNs'
88+
assert instance.errors[0].meta.code == 1001
89+
90+
if __name__ == '__main__':
91+
unittest.main()
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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_async_bulk_lookup_response_data import CreateAsyncBulkLookupResponseData
19+
from bandwidth.models.in_progress_lookup_status_enum import InProgressLookupStatusEnum
20+
21+
class TestCreateAsyncBulkLookupResponseData(unittest.TestCase):
22+
"""CreateAsyncBulkLookupResponseData 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) -> CreateAsyncBulkLookupResponseData:
31+
"""Test CreateAsyncBulkLookupResponseData
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 CreateAsyncBulkLookupResponseData(
37+
request_id = '004223a0-8b17-41b1-bf81-20732adf5590',
38+
status = InProgressLookupStatusEnum('COMPLETE')
39+
)
40+
else:
41+
return CreateAsyncBulkLookupResponseData(
42+
)
43+
44+
def testCreateAsyncBulkLookupResponseData(self):
45+
"""Test CreateAsyncBulkLookupResponseData"""
46+
instance = self.make_instance(True)
47+
assert instance is not None
48+
assert isinstance(instance, CreateAsyncBulkLookupResponseData)
49+
assert instance.request_id == '004223a0-8b17-41b1-bf81-20732adf5590'
50+
assert instance.status == InProgressLookupStatusEnum('COMPLETE')
51+
52+
if __name__ == '__main__':
53+
unittest.main()
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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.create_multi_channel_message_response import CreateMultiChannelMessageResponse
20+
from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData
21+
from bandwidth.models.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner
22+
from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent
23+
24+
class TestCreateMultiChannelMessageResponse(unittest.TestCase):
25+
"""CreateMultiChannelMessageResponse unit test stubs"""
26+
27+
def setUp(self):
28+
pass
29+
30+
def tearDown(self):
31+
pass
32+
33+
def make_instance(self, include_optional) -> CreateMultiChannelMessageResponse:
34+
"""Test CreateMultiChannelMessageResponse
35+
include_optional is a boolean, when False only required
36+
params are included, when True both required and
37+
optional params are included """
38+
if include_optional:
39+
return CreateMultiChannelMessageResponse(
40+
links = [],
41+
data = MultiChannelMessageResponseData(
42+
id = '1589228074636lm4k2je7j7jklbn2',
43+
time = '2025-01-01T18:20:16Z',
44+
direction = 'in',
45+
to = ["+15554443333"],
46+
channel_list = [
47+
MultiChannelMessageResponseDataChannelListInner(
48+
var_from = 'BandwidthRBM',
49+
application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
50+
channel = 'RBM',
51+
content = MultiChannelChannelListObjectContent(),
52+
owner = 'owner',
53+
)],
54+
tag = 'custom string',
55+
priority = 'default',
56+
expiration = '2021-02-01T11:29:18-05:00', ),
57+
errors = []
58+
)
59+
else:
60+
return CreateMultiChannelMessageResponse(
61+
)
62+
63+
def testCreateMultiChannelMessageResponse(self):
64+
"""Test CreateMultiChannelMessageResponse"""
65+
instance = self.make_instance(True)
66+
assert instance is not None
67+
assert isinstance(instance, CreateMultiChannelMessageResponse)
68+
assert instance.links == []
69+
assert instance.data is not None
70+
assert isinstance(instance.data, MultiChannelMessageResponseData)
71+
assert instance.data.id == '1589228074636lm4k2je7j7jklbn2'
72+
assert isinstance(instance.data.time, datetime)
73+
assert instance.data.direction == 'in'
74+
assert instance.data.to == ["+15554443333"]
75+
assert isinstance(instance.data.channel_list, list)
76+
assert isinstance(instance.data.channel_list[0], MultiChannelMessageResponseDataChannelListInner)
77+
assert instance.data.tag == 'custom string'
78+
assert instance.data.priority == 'default'
79+
assert isinstance(instance.data.expiration, datetime)
80+
assert instance.errors == []
81+
82+
if __name__ == '__main__':
83+
unittest.main()

0 commit comments

Comments
 (0)