|
| 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.inbound_callback_message import InboundCallbackMessage |
| 20 | +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent |
| 21 | +from bandwidth.models.rbm_location_response import RbmLocationResponse |
| 22 | +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse |
| 23 | +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile |
| 24 | + |
| 25 | +class TestInboundCallbackMessage(unittest.TestCase): |
| 26 | + """InboundCallbackMessage 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) -> InboundCallbackMessage: |
| 35 | + """Test InboundCallbackMessage |
| 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 InboundCallbackMessage( |
| 41 | + id = '1661365814859loidf7mcwd4qacn7', |
| 42 | + owner = '+15553332222', |
| 43 | + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', |
| 44 | + time = '2024-12-02T20:15:57.666Z', |
| 45 | + segment_count = 1, |
| 46 | + direction = 'in', |
| 47 | + to = ['+15552223333'], |
| 48 | + var_from = '+15553332222', |
| 49 | + text = 'Hello world', |
| 50 | + tag = 'custom string', |
| 51 | + media = ['https://dev.bandwidth.com/images/bandwidth-logo.png', 'https://dev.bandwidth.com/images/github_logo.png'], |
| 52 | + priority = 'default', |
| 53 | + channel = 'RBM', |
| 54 | + content = MultiChannelMessageContent( |
| 55 | + text = '', |
| 56 | + media = RbmMessageContentFile( |
| 57 | + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', |
| 58 | + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', ), ), |
| 59 | + suggestion_response = RbmSuggestionResponse( |
| 60 | + text = 'Yes, I would like to proceed', |
| 61 | + postback_data = '[B@5d4a34ff', ), |
| 62 | + location_response = RbmLocationResponse( |
| 63 | + latitude = '37.7749', |
| 64 | + longitude = '-122.4194', ) |
| 65 | + ) |
| 66 | + else: |
| 67 | + return InboundCallbackMessage( |
| 68 | + id = '1661365814859loidf7mcwd4qacn7', |
| 69 | + owner = '+15553332222', |
| 70 | + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', |
| 71 | + time = '2024-12-02T20:15:57.666Z', |
| 72 | + segment_count = 1, |
| 73 | + direction = 'in', |
| 74 | + to = ['+15552223333'], |
| 75 | + var_from = '+15553332222', |
| 76 | + ) |
| 77 | + |
| 78 | + def testInboundCallbackMessage(self): |
| 79 | + """Test InboundCallbackMessage""" |
| 80 | + instance = self.make_instance(True) |
| 81 | + assert instance is not None |
| 82 | + assert isinstance(instance, InboundCallbackMessage) |
| 83 | + assert instance.id == '1661365814859loidf7mcwd4qacn7' |
| 84 | + assert instance.owner == '+15553332222' |
| 85 | + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' |
| 86 | + assert isinstance(instance.time, datetime) |
| 87 | + assert instance.segment_count == 1 |
| 88 | + assert instance.direction == 'in' |
| 89 | + assert instance.to == ['+15552223333'] |
| 90 | + assert instance.var_from == '+15553332222' |
| 91 | + assert instance.text == 'Hello world' |
| 92 | + assert instance.tag == 'custom string' |
| 93 | + assert isinstance(instance.media, list) |
| 94 | + assert len(instance.media) > 0 |
| 95 | + assert isinstance(instance.content, MultiChannelMessageContent) |
| 96 | + assert isinstance(instance.suggestion_response, RbmSuggestionResponse) |
| 97 | + assert isinstance(instance.location_response, RbmLocationResponse) |
| 98 | + |
| 99 | +if __name__ == '__main__': |
| 100 | + unittest.main() |
0 commit comments