Skip to content

Commit a0448b4

Browse files
committed
Merge branch 'main' of https://github.com/Bandwidth/python-sdk into SWI-7768
2 parents 9306560 + c7b0321 commit a0448b4

38 files changed

+2313
-0
lines changed

test/smoke/test_conferences_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def test_conference_and_members(self):
248248
BW_ACCOUNT_ID, call_id, update_call
249249
)
250250

251+
@unittest.skip("PV Issues")
251252
def test_conference_recordings(self) -> None:
252253
"""
253254
Tests a successful flow of creating a call with a recording.
@@ -410,6 +411,7 @@ def test_update_conference_forbidden(self) -> None:
410411

411412
self.assertApiException(context, ForbiddenException, 403)
412413

414+
@unittest.skip("PV Issues")
413415
def test_update_conference_not_found(self) -> None:
414416
with self.assertRaises(NotFoundException) as context:
415417
self.conference_api_instance.update_conference(
@@ -431,6 +433,7 @@ def test_update_conference_bxml_forbidden(self) -> None:
431433

432434
self.assertApiException(context, ForbiddenException, 403)
433435

436+
@unittest.skip("PV Issues")
434437
def test_update_conference_bxml_not_found(self) -> None:
435438
with self.assertRaises(NotFoundException) as context:
436439
self.conference_api_instance.update_conference_bxml(
@@ -452,6 +455,7 @@ def test_update_conference_member_forbidden(self) -> None:
452455

453456
self.assertApiException(context, ForbiddenException, 403)
454457

458+
@unittest.skip("PV Issues")
455459
def test_update_conference_member_not_found(self) -> None:
456460
with self.assertRaises(NotFoundException) as context:
457461
self.conference_api_instance.update_conference_member(
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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, timedelta
18+
from zoneinfo import ZoneInfo
19+
20+
from hamcrest import *
21+
from test.utils.env_variables import *
22+
from bandwidth import ApiClient, Configuration
23+
from bandwidth.api.multi_channel_api import MultiChannelApi
24+
from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest
25+
from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject
26+
from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum
27+
from bandwidth.models.rbm_message_content_text import RbmMessageContentText
28+
from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent
29+
30+
31+
class TestMultiChannelApi(unittest.TestCase):
32+
"""MultiChannelApi unit test stubs"""
33+
34+
def setUp(self) -> None:
35+
configuration = Configuration(
36+
username=BW_USERNAME,
37+
password=BW_PASSWORD,
38+
)
39+
api_client = ApiClient(configuration)
40+
self.multi_channel_api_instance = MultiChannelApi(api_client)
41+
42+
self.expiration = datetime.now(ZoneInfo('America/New_York')) + timedelta(minutes=1)
43+
44+
def test_create_multi_channel_message(self) -> None:
45+
"""Test case for create_multi_channel_message
46+
47+
Create Multi-Channel Message
48+
"""
49+
50+
channel_list_item = MultiChannelChannelListObject(
51+
var_from = BW_NUMBER,
52+
application_id = BW_MESSAGING_APPLICATION_ID,
53+
channel = MultiChannelMessageChannelEnum('RBM'),
54+
content = MultiChannelChannelListObjectContent(
55+
RbmMessageContentText(
56+
text = 'Hello, this is a test message.',
57+
)
58+
)
59+
)
60+
multi_channel_message_request = MultiChannelMessageRequest(
61+
to = USER_NUMBER,
62+
channel_list = [channel_list_item],
63+
tag = 'tag',
64+
priority = 'high',
65+
expiration = self.expiration
66+
)
67+
68+
response = self.multi_channel_api_instance.create_multi_channel_message_with_http_info(
69+
BW_ACCOUNT_ID,
70+
multi_channel_message_request
71+
)
72+
assert_that(response.status_code, equal_to(202))
73+
74+
if __name__ == '__main__':
75+
unittest.main()

test/smoke/test_recordings_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ def test_4xx_errors(self) -> None:
496496
assert_that(calling(self.recordings_api_instance.delete_recording).with_args(
497497
BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
498498

499+
@unittest.skip("PV Issues")
499500
def test_invalid_update_call_recording_state(self) -> None:
500501
"""
501502
Tests invalid flows for update_call_recording_state

test/smoke/test_transcriptions_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def _steps(self):
144144
for name in call_order:
145145
yield name, getattr(self, name)
146146

147+
@unittest.skip("PV Issues")
147148
def test_steps(self) -> None:
148149
"""Test each function from _steps.call_order in specified order
149150
"""
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 hamcrest import *
19+
from test.utils.env_variables import *
20+
from bandwidth import ApiClient, Configuration
21+
from bandwidth.api.multi_channel_api import MultiChannelApi
22+
from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest
23+
from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject
24+
from bandwidth.models.sms_message_content import SmsMessageContent
25+
from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum
26+
from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent
27+
28+
29+
class TestMultiChannelApi(unittest.TestCase):
30+
"""MultiChannelApi unit test stubs"""
31+
32+
def setUp(self) -> None:
33+
configuration = Configuration(
34+
username=BW_USERNAME,
35+
password=BW_PASSWORD,
36+
host='http://127.0.0.1:4010',
37+
ignore_operation_servers=True
38+
)
39+
api_client = ApiClient(configuration)
40+
self.multi_channel_api_instance = MultiChannelApi(api_client)
41+
42+
@unittest.skip("skip because prism can't handle a oneOf with differing required fields")
43+
def test_create_multi_channel_message(self) -> None:
44+
"""Test case for create_multi_channel_message
45+
46+
Create Multi-Channel Message
47+
"""
48+
49+
channel_list_item = MultiChannelChannelListObject(
50+
var_from = BW_NUMBER,
51+
application_id = BW_MESSAGING_APPLICATION_ID,
52+
channel = MultiChannelMessageChannelEnum('SMS'),
53+
content = MultiChannelChannelListObjectContent(
54+
SmsMessageContent(
55+
text = 'Hello, this is a test message.',
56+
)
57+
)
58+
)
59+
multi_channel_message_request = MultiChannelMessageRequest(
60+
to = USER_NUMBER,
61+
channel_list = [channel_list_item],
62+
tag = 'tag',
63+
priority = 'high',
64+
expiration = '2023-10-01T00:00:00Z',
65+
)
66+
67+
response = self.multi_channel_api_instance.create_multi_channel_message_with_http_info(BW_ACCOUNT_ID, multi_channel_message_request)
68+
assert_that(response.status_code, equal_to(202))
69+
70+
if __name__ == '__main__':
71+
unittest.main()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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.card_width_enum import CardWidthEnum
19+
20+
class TestCardWidthEnum(unittest.TestCase):
21+
"""CardWidthEnum unit test stubs"""
22+
23+
def setUp(self):
24+
pass
25+
26+
def tearDown(self):
27+
pass
28+
29+
def testCardWidthEnum(self):
30+
"""Test CardWidthEnum"""
31+
small = CardWidthEnum('SMALL')
32+
medium = CardWidthEnum('MEDIUM')
33+
assert small == 'SMALL'
34+
assert medium == 'MEDIUM'
35+
36+
if __name__ == '__main__':
37+
unittest.main()
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()

0 commit comments

Comments
 (0)