From 0cb33fb8de75aaa504809324685734324e0dd9ea Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Wed, 3 Aug 2022 14:05:30 -0400 Subject: [PATCH 01/10] DX-2690, DX-2693 `webrtc_api` Integration Tests --- .gitignore | 9 - .openapi-generator/FILES | 510 ++++++++++++++-------------- bandwidth.json | 3 - bandwidth/model/subscriptions.py | 14 +- docs/Subscriptions.md | 2 +- test-requirements.txt | 1 + test/integration/test_webrtc_api.py | 133 ++++++++ 7 files changed, 394 insertions(+), 278 deletions(-) create mode 100644 test/integration/test_webrtc_api.py diff --git a/.gitignore b/.gitignore index 3ea0fbac..43995bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,6 @@ __pycache__/ # C extensions *.so -# MacOS Files -.DS_Store - # Distribution / packaging .Python env/ @@ -67,9 +64,3 @@ target/ #Ipython Notebook .ipynb_checkpoints - -# VS Code -.vscode - -# Test Fixtures -test/fixtures/ diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 198adfc8..a814c8c8 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,255 +1,255 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -bandwidth/__init__.py -bandwidth/api/__init__.py -bandwidth/api/calls_api.py -bandwidth/api/conferences_api.py -bandwidth/api/media_api.py -bandwidth/api/messages_api.py -bandwidth/api/mfa_api.py -bandwidth/api/participants_api.py -bandwidth/api/phone_number_lookup_api.py -bandwidth/api/recordings_api.py -bandwidth/api/sessions_api.py -bandwidth/api/statistics_api.py -bandwidth/api_client.py -bandwidth/apis/__init__.py -bandwidth/configuration.py -bandwidth/exceptions.py -bandwidth/model/__init__.py -bandwidth/model/account_statistics.py -bandwidth/model/call_callback.py -bandwidth/model/call_direction_enum.py -bandwidth/model/call_recording_metadata.py -bandwidth/model/call_state.py -bandwidth/model/call_state_enum.py -bandwidth/model/callback_method_enum.py -bandwidth/model/code_request.py -bandwidth/model/conference.py -bandwidth/model/conference_callback.py -bandwidth/model/conference_member.py -bandwidth/model/conference_recording_metadata.py -bandwidth/model/conference_state_enum.py -bandwidth/model/create_call.py -bandwidth/model/create_call_response.py -bandwidth/model/create_lookup_response.py -bandwidth/model/create_participant_request.py -bandwidth/model/create_participant_response.py -bandwidth/model/deferred_result.py -bandwidth/model/device_api_version_enum.py -bandwidth/model/diversion.py -bandwidth/model/file_format_enum.py -bandwidth/model/forbidden_request.py -bandwidth/model/list_message_direction_enum.py -bandwidth/model/list_message_item.py -bandwidth/model/lookup_request.py -bandwidth/model/lookup_result.py -bandwidth/model/lookup_status.py -bandwidth/model/lookup_status_enum.py -bandwidth/model/machine_detection_configuration.py -bandwidth/model/machine_detection_mode_enum.py -bandwidth/model/media.py -bandwidth/model/message.py -bandwidth/model/message_direction_enum.py -bandwidth/model/message_request.py -bandwidth/model/message_status_enum.py -bandwidth/model/message_type_enum.py -bandwidth/model/messages_list.py -bandwidth/model/messaging_code_response.py -bandwidth/model/messaging_request_error.py -bandwidth/model/mfa_forbidden_request_error.py -bandwidth/model/mfa_request_error.py -bandwidth/model/mfa_unauthorized_request_error.py -bandwidth/model/page_info.py -bandwidth/model/participant.py -bandwidth/model/participant_subscription.py -bandwidth/model/priority_enum.py -bandwidth/model/publish_permissions_enum.py -bandwidth/model/recording_state_enum.py -bandwidth/model/redirect_method_enum.py -bandwidth/model/request_error.py -bandwidth/model/session.py -bandwidth/model/subscriptions.py -bandwidth/model/tag.py -bandwidth/model/tn_lookup_request_error.py -bandwidth/model/transcribe_recording.py -bandwidth/model/transcription.py -bandwidth/model/transcription_list.py -bandwidth/model/transcription_metadata.py -bandwidth/model/unauthorized_request.py -bandwidth/model/update_call.py -bandwidth/model/update_call_recording.py -bandwidth/model/update_conference.py -bandwidth/model/update_conference_member.py -bandwidth/model/verify_code_request.py -bandwidth/model/verify_code_response.py -bandwidth/model/voice_api_error.py -bandwidth/model/voice_code_response.py -bandwidth/model_utils.py -bandwidth/models/__init__.py -bandwidth/rest.py -docs/AccountStatistics.md -docs/CallCallback.md -docs/CallDirectionEnum.md -docs/CallRecordingMetadata.md -docs/CallState.md -docs/CallStateEnum.md -docs/CallbackMethodEnum.md -docs/CallsApi.md -docs/CodeRequest.md -docs/Conference.md -docs/ConferenceCallback.md -docs/ConferenceMember.md -docs/ConferenceRecordingMetadata.md -docs/ConferenceStateEnum.md -docs/ConferencesApi.md -docs/CreateCall.md -docs/CreateCallResponse.md -docs/CreateLookupResponse.md -docs/CreateParticipantRequest.md -docs/CreateParticipantResponse.md -docs/DeferredResult.md -docs/DeviceApiVersionEnum.md -docs/Diversion.md -docs/FileFormatEnum.md -docs/ForbiddenRequest.md -docs/ListMessageDirectionEnum.md -docs/ListMessageItem.md -docs/LookupRequest.md -docs/LookupResult.md -docs/LookupStatus.md -docs/LookupStatusEnum.md -docs/MFAApi.md -docs/MachineDetectionConfiguration.md -docs/MachineDetectionModeEnum.md -docs/Media.md -docs/MediaApi.md -docs/Message.md -docs/MessageDirectionEnum.md -docs/MessageRequest.md -docs/MessageStatusEnum.md -docs/MessageTypeEnum.md -docs/MessagesApi.md -docs/MessagesList.md -docs/MessagingCodeResponse.md -docs/MessagingRequestError.md -docs/MfaForbiddenRequestError.md -docs/MfaRequestError.md -docs/MfaUnauthorizedRequestError.md -docs/PageInfo.md -docs/Participant.md -docs/ParticipantSubscription.md -docs/ParticipantsApi.md -docs/PhoneNumberLookupApi.md -docs/PriorityEnum.md -docs/PublishPermissionsEnum.md -docs/RecordingStateEnum.md -docs/RecordingsApi.md -docs/RedirectMethodEnum.md -docs/RequestError.md -docs/Session.md -docs/SessionsApi.md -docs/StatisticsApi.md -docs/Subscriptions.md -docs/Tag.md -docs/TnLookupRequestError.md -docs/TranscribeRecording.md -docs/Transcription.md -docs/TranscriptionList.md -docs/TranscriptionMetadata.md -docs/UnauthorizedRequest.md -docs/UpdateCall.md -docs/UpdateCallRecording.md -docs/UpdateConference.md -docs/UpdateConferenceMember.md -docs/VerifyCodeRequest.md -docs/VerifyCodeResponse.md -docs/VoiceApiError.md -docs/VoiceCodeResponse.md -git_push.sh -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -test/test_account_statistics.py -test/test_call_callback.py -test/test_call_direction_enum.py -test/test_call_recording_metadata.py -test/test_call_state.py -test/test_call_state_enum.py -test/test_callback_method_enum.py -test/test_calls_api.py -test/test_code_request.py -test/test_conference.py -test/test_conference_callback.py -test/test_conference_member.py -test/test_conference_recording_metadata.py -test/test_conference_state_enum.py -test/test_conferences_api.py -test/test_create_call.py -test/test_create_call_response.py -test/test_create_lookup_response.py -test/test_create_participant_request.py -test/test_create_participant_response.py -test/test_deferred_result.py -test/test_device_api_version_enum.py -test/test_diversion.py -test/test_file_format_enum.py -test/test_forbidden_request.py -test/test_list_message_direction_enum.py -test/test_list_message_item.py -test/test_lookup_request.py -test/test_lookup_result.py -test/test_lookup_status.py -test/test_lookup_status_enum.py -test/test_machine_detection_configuration.py -test/test_machine_detection_mode_enum.py -test/test_media.py -test/test_media_api.py -test/test_message.py -test/test_message_direction_enum.py -test/test_message_request.py -test/test_message_status_enum.py -test/test_message_type_enum.py -test/test_messages_api.py -test/test_messages_list.py -test/test_messaging_code_response.py -test/test_messaging_request_error.py -test/test_mfa_api.py -test/test_mfa_forbidden_request_error.py -test/test_mfa_request_error.py -test/test_mfa_unauthorized_request_error.py -test/test_page_info.py -test/test_participant.py -test/test_participant_subscription.py -test/test_participants_api.py -test/test_phone_number_lookup_api.py -test/test_priority_enum.py -test/test_publish_permissions_enum.py -test/test_recording_state_enum.py -test/test_recordings_api.py -test/test_redirect_method_enum.py -test/test_request_error.py -test/test_session.py -test/test_sessions_api.py -test/test_statistics_api.py -test/test_subscriptions.py -test/test_tag.py -test/test_tn_lookup_request_error.py -test/test_transcribe_recording.py -test/test_transcription.py -test/test_transcription_list.py -test/test_transcription_metadata.py -test/test_unauthorized_request.py -test/test_update_call.py -test/test_update_call_recording.py -test/test_update_conference.py -test/test_update_conference_member.py -test/test_verify_code_request.py -test/test_verify_code_response.py -test/test_voice_api_error.py -test/test_voice_code_response.py -tox.ini +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +bandwidth/__init__.py +bandwidth/api/__init__.py +bandwidth/api/calls_api.py +bandwidth/api/conferences_api.py +bandwidth/api/media_api.py +bandwidth/api/messages_api.py +bandwidth/api/mfa_api.py +bandwidth/api/participants_api.py +bandwidth/api/phone_number_lookup_api.py +bandwidth/api/recordings_api.py +bandwidth/api/sessions_api.py +bandwidth/api/statistics_api.py +bandwidth/api_client.py +bandwidth/apis/__init__.py +bandwidth/configuration.py +bandwidth/exceptions.py +bandwidth/model/__init__.py +bandwidth/model/account_statistics.py +bandwidth/model/call_callback.py +bandwidth/model/call_direction_enum.py +bandwidth/model/call_recording_metadata.py +bandwidth/model/call_state.py +bandwidth/model/call_state_enum.py +bandwidth/model/callback_method_enum.py +bandwidth/model/code_request.py +bandwidth/model/conference.py +bandwidth/model/conference_callback.py +bandwidth/model/conference_member.py +bandwidth/model/conference_recording_metadata.py +bandwidth/model/conference_state_enum.py +bandwidth/model/create_call.py +bandwidth/model/create_call_response.py +bandwidth/model/create_lookup_response.py +bandwidth/model/create_participant_request.py +bandwidth/model/create_participant_response.py +bandwidth/model/deferred_result.py +bandwidth/model/device_api_version_enum.py +bandwidth/model/diversion.py +bandwidth/model/file_format_enum.py +bandwidth/model/forbidden_request.py +bandwidth/model/list_message_direction_enum.py +bandwidth/model/list_message_item.py +bandwidth/model/lookup_request.py +bandwidth/model/lookup_result.py +bandwidth/model/lookup_status.py +bandwidth/model/lookup_status_enum.py +bandwidth/model/machine_detection_configuration.py +bandwidth/model/machine_detection_mode_enum.py +bandwidth/model/media.py +bandwidth/model/message.py +bandwidth/model/message_direction_enum.py +bandwidth/model/message_request.py +bandwidth/model/message_status_enum.py +bandwidth/model/message_type_enum.py +bandwidth/model/messages_list.py +bandwidth/model/messaging_code_response.py +bandwidth/model/messaging_request_error.py +bandwidth/model/mfa_forbidden_request_error.py +bandwidth/model/mfa_request_error.py +bandwidth/model/mfa_unauthorized_request_error.py +bandwidth/model/page_info.py +bandwidth/model/participant.py +bandwidth/model/participant_subscription.py +bandwidth/model/priority_enum.py +bandwidth/model/publish_permissions_enum.py +bandwidth/model/recording_state_enum.py +bandwidth/model/redirect_method_enum.py +bandwidth/model/request_error.py +bandwidth/model/session.py +bandwidth/model/subscriptions.py +bandwidth/model/tag.py +bandwidth/model/tn_lookup_request_error.py +bandwidth/model/transcribe_recording.py +bandwidth/model/transcription.py +bandwidth/model/transcription_list.py +bandwidth/model/transcription_metadata.py +bandwidth/model/unauthorized_request.py +bandwidth/model/update_call.py +bandwidth/model/update_call_recording.py +bandwidth/model/update_conference.py +bandwidth/model/update_conference_member.py +bandwidth/model/verify_code_request.py +bandwidth/model/verify_code_response.py +bandwidth/model/voice_api_error.py +bandwidth/model/voice_code_response.py +bandwidth/model_utils.py +bandwidth/models/__init__.py +bandwidth/rest.py +docs/AccountStatistics.md +docs/CallCallback.md +docs/CallDirectionEnum.md +docs/CallRecordingMetadata.md +docs/CallState.md +docs/CallStateEnum.md +docs/CallbackMethodEnum.md +docs/CallsApi.md +docs/CodeRequest.md +docs/Conference.md +docs/ConferenceCallback.md +docs/ConferenceMember.md +docs/ConferenceRecordingMetadata.md +docs/ConferenceStateEnum.md +docs/ConferencesApi.md +docs/CreateCall.md +docs/CreateCallResponse.md +docs/CreateLookupResponse.md +docs/CreateParticipantRequest.md +docs/CreateParticipantResponse.md +docs/DeferredResult.md +docs/DeviceApiVersionEnum.md +docs/Diversion.md +docs/FileFormatEnum.md +docs/ForbiddenRequest.md +docs/ListMessageDirectionEnum.md +docs/ListMessageItem.md +docs/LookupRequest.md +docs/LookupResult.md +docs/LookupStatus.md +docs/LookupStatusEnum.md +docs/MFAApi.md +docs/MachineDetectionConfiguration.md +docs/MachineDetectionModeEnum.md +docs/Media.md +docs/MediaApi.md +docs/Message.md +docs/MessageDirectionEnum.md +docs/MessageRequest.md +docs/MessageStatusEnum.md +docs/MessageTypeEnum.md +docs/MessagesApi.md +docs/MessagesList.md +docs/MessagingCodeResponse.md +docs/MessagingRequestError.md +docs/MfaForbiddenRequestError.md +docs/MfaRequestError.md +docs/MfaUnauthorizedRequestError.md +docs/PageInfo.md +docs/Participant.md +docs/ParticipantSubscription.md +docs/ParticipantsApi.md +docs/PhoneNumberLookupApi.md +docs/PriorityEnum.md +docs/PublishPermissionsEnum.md +docs/RecordingStateEnum.md +docs/RecordingsApi.md +docs/RedirectMethodEnum.md +docs/RequestError.md +docs/Session.md +docs/SessionsApi.md +docs/StatisticsApi.md +docs/Subscriptions.md +docs/Tag.md +docs/TnLookupRequestError.md +docs/TranscribeRecording.md +docs/Transcription.md +docs/TranscriptionList.md +docs/TranscriptionMetadata.md +docs/UnauthorizedRequest.md +docs/UpdateCall.md +docs/UpdateCallRecording.md +docs/UpdateConference.md +docs/UpdateConferenceMember.md +docs/VerifyCodeRequest.md +docs/VerifyCodeResponse.md +docs/VoiceApiError.md +docs/VoiceCodeResponse.md +git_push.sh +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_statistics.py +test/test_call_callback.py +test/test_call_direction_enum.py +test/test_call_recording_metadata.py +test/test_call_state.py +test/test_call_state_enum.py +test/test_callback_method_enum.py +test/test_calls_api.py +test/test_code_request.py +test/test_conference.py +test/test_conference_callback.py +test/test_conference_member.py +test/test_conference_recording_metadata.py +test/test_conference_state_enum.py +test/test_conferences_api.py +test/test_create_call.py +test/test_create_call_response.py +test/test_create_lookup_response.py +test/test_create_participant_request.py +test/test_create_participant_response.py +test/test_deferred_result.py +test/test_device_api_version_enum.py +test/test_diversion.py +test/test_file_format_enum.py +test/test_forbidden_request.py +test/test_list_message_direction_enum.py +test/test_list_message_item.py +test/test_lookup_request.py +test/test_lookup_result.py +test/test_lookup_status.py +test/test_lookup_status_enum.py +test/test_machine_detection_configuration.py +test/test_machine_detection_mode_enum.py +test/test_media.py +test/test_media_api.py +test/test_message.py +test/test_message_direction_enum.py +test/test_message_request.py +test/test_message_status_enum.py +test/test_message_type_enum.py +test/test_messages_api.py +test/test_messages_list.py +test/test_messaging_code_response.py +test/test_messaging_request_error.py +test/test_mfa_api.py +test/test_mfa_forbidden_request_error.py +test/test_mfa_request_error.py +test/test_mfa_unauthorized_request_error.py +test/test_page_info.py +test/test_participant.py +test/test_participant_subscription.py +test/test_participants_api.py +test/test_phone_number_lookup_api.py +test/test_priority_enum.py +test/test_publish_permissions_enum.py +test/test_recording_state_enum.py +test/test_recordings_api.py +test/test_redirect_method_enum.py +test/test_request_error.py +test/test_session.py +test/test_sessions_api.py +test/test_statistics_api.py +test/test_subscriptions.py +test/test_tag.py +test/test_tn_lookup_request_error.py +test/test_transcribe_recording.py +test/test_transcription.py +test/test_transcription_list.py +test/test_transcription_metadata.py +test/test_unauthorized_request.py +test/test_update_call.py +test/test_update_call_recording.py +test/test_update_conference.py +test/test_update_conference_member.py +test/test_verify_code_request.py +test/test_verify_code_response.py +test/test_voice_api_error.py +test/test_voice_code_response.py +tox.ini diff --git a/bandwidth.json b/bandwidth.json index 8c213b4a..96ddf795 100644 --- a/bandwidth.json +++ b/bandwidth.json @@ -4386,9 +4386,6 @@ "subscriptions": { "type": "object", "readOnly": true, - "required": [ - "sessionId" - ], "properties": { "sessionId": { "type": "string", diff --git a/bandwidth/model/subscriptions.py b/bandwidth/model/subscriptions.py index 873f9c30..61149700 100644 --- a/bandwidth/model/subscriptions.py +++ b/bandwidth/model/subscriptions.py @@ -109,12 +109,9 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, session_id, *args, **kwargs): # noqa: E501 + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 """Subscriptions - a model defined in OpenAPI - Args: - session_id (str): Session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -146,6 +143,7 @@ def _from_openapi_data(cls, session_id, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + session_id (str): Session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object.. [optional] # noqa: E501 participants ([ParticipantSubscription]): (optional) A list of participants in the session that will be subscribed to. Returns empty if used during the creation of a Participant. . [optional] # noqa: E501 """ @@ -178,7 +176,6 @@ def _from_openapi_data(cls, session_id, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.session_id = session_id for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ @@ -199,12 +196,9 @@ def _from_openapi_data(cls, session_id, *args, **kwargs): # noqa: E501 ]) @convert_js_args_to_python_args - def __init__(self, session_id, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """Subscriptions - a model defined in OpenAPI - Args: - session_id (str): Session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -236,6 +230,7 @@ def __init__(self, session_id, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + session_id (str): Session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object.. [optional] # noqa: E501 participants ([ParticipantSubscription]): (optional) A list of participants in the session that will be subscribed to. Returns empty if used during the creation of a Participant. . [optional] # noqa: E501 """ @@ -266,7 +261,6 @@ def __init__(self, session_id, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.session_id = session_id for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ diff --git a/docs/Subscriptions.md b/docs/Subscriptions.md index 4684685a..9c64c297 100644 --- a/docs/Subscriptions.md +++ b/docs/Subscriptions.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**session_id** | **str** | Session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. | +**session_id** | **str** | Session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. | [optional] **participants** | [**[ParticipantSubscription]**](ParticipantSubscription.md) | (optional) A list of participants in the session that will be subscribed to. Returns empty if used during the creation of a Participant. | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/test-requirements.txt b/test-requirements.txt index bb4f22bb..c62d58da 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +1,2 @@ pytest-cov>=2.8.1 +PyHamcrest>=2.0.0 \ No newline at end of file diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py new file mode 100644 index 00000000..548e5231 --- /dev/null +++ b/test/integration/test_webrtc_api.py @@ -0,0 +1,133 @@ +""" + Bandwidth + + Bandwidth's Communication APIs # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by: https://openapi-generator.tech +""" + + +import os +import unittest + +import bandwidth +from hamcrest import * +from bandwidth.api import participants_api, sessions_api +from bandwidth.model.create_participant_request import CreateParticipantRequest +from bandwidth.model.create_participant_response import CreateParticipantResponse +from bandwidth.model.publish_permissions_enum import PublishPermissionsEnum +from bandwidth.model.device_api_version_enum import DeviceApiVersionEnum +from bandwidth.model.participant import Participant + + +class TestSessionsApi(unittest.TestCase): + """SessionsApi unit test stubs""" + + def setUp(self): + # API Client + configuration = bandwidth.Configuration( + username = os.environ.get('BW_USERNAME'), + password = os.environ.get('BW_PASSWORD') + ) + api_client = bandwidth.ApiClient(configuration) + self.sessions_api_instance = sessions_api.SessionsApi(api_client) + self.participants_api_instance = participants_api.ParticipantsApi(api_client) + self.account_id = os.environ.get('BW_ACCOUNT_ID') + + def test_create_participant(self): + create_participant_request = CreateParticipantRequest( + callback_url="https://example.com/callback", + publish_permissions=[ + PublishPermissionsEnum('AUDIO'), + PublishPermissionsEnum('VIDEO') + ], + tag="participant1", + device_api_version=DeviceApiVersionEnum("V3"), + ) + response = self.participants_api_instance.create_participant(self.account_id, create_participant_request=create_participant_request, _return_http_data_only=False) + + self.assertEqual(response[1], 200) + assert_that + + api_response = response[0] + self.assertIsInstance(api_response, CreateParticipantResponse) + self.assertIsInstance(api_response.participant, Participant) + print(api_response.participant['callback_url']) + self.assertEqual(api_response.participant.callback_url, create_participant_request.callback_url) + #self.assertEqual(api_response.publish_permissions, create_participant_request.publish_permissions) + + def test_delete_participant(self): + """Test case for delete_participant + + Delete Participant # noqa: E501 + """ + pass + + def test_get_participant(self): + """Test case for get_participant + + Get Participant # noqa: E501 + """ + pass + + def test_add_participant_to_session(self): + """Test case for add_participant_to_session + + Add Participant to Session # noqa: E501 + """ + pass + + def test_create_session(self): + """Test case for create_session + + Create Session # noqa: E501 + """ + pass + + def test_delete_session(self): + """Test case for delete_session + + Delete Session # noqa: E501 + """ + pass + + def test_get_participant_subscriptions(self): + """Test case for get_participant_subscriptions + + Get Participant Subscriptions # noqa: E501 + """ + pass + + def test_get_session(self): + """Test case for get_session + + Get Session # noqa: E501 + """ + pass + + def test_list_session_participants(self): + """Test case for list_session_participants + + List Participants in Session # noqa: E501 + """ + pass + + def test_remove_participant_from_session(self): + """Test case for remove_participant_from_session + + Remove Participant from Session # noqa: E501 + """ + pass + + def test_update_participant_subscriptions(self): + """Test case for update_participant_subscriptions + + Update Participant Subscriptions # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() From 1813fef74646e733d78205bb57f5d6c49606e8ad Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Wed, 3 Aug 2022 14:14:05 -0400 Subject: [PATCH 02/10] revert files --- .openapi-generator/FILES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 198adfc8..ea0a37b2 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -35,11 +35,13 @@ bandwidth/model/conference_state_enum.py bandwidth/model/create_call.py bandwidth/model/create_call_response.py bandwidth/model/create_lookup_response.py +bandwidth/model/create_message_request_error.py bandwidth/model/create_participant_request.py bandwidth/model/create_participant_response.py bandwidth/model/deferred_result.py bandwidth/model/device_api_version_enum.py bandwidth/model/diversion.py +bandwidth/model/field_error.py bandwidth/model/file_format_enum.py bandwidth/model/forbidden_request.py bandwidth/model/list_message_direction_enum.py @@ -108,11 +110,13 @@ docs/ConferencesApi.md docs/CreateCall.md docs/CreateCallResponse.md docs/CreateLookupResponse.md +docs/CreateMessageRequestError.md docs/CreateParticipantRequest.md docs/CreateParticipantResponse.md docs/DeferredResult.md docs/DeviceApiVersionEnum.md docs/Diversion.md +docs/FieldError.md docs/FileFormatEnum.md docs/ForbiddenRequest.md docs/ListMessageDirectionEnum.md @@ -192,11 +196,13 @@ test/test_conferences_api.py test/test_create_call.py test/test_create_call_response.py test/test_create_lookup_response.py +test/test_create_message_request_error.py test/test_create_participant_request.py test/test_create_participant_response.py test/test_deferred_result.py test/test_device_api_version_enum.py test/test_diversion.py +test/test_field_error.py test/test_file_format_enum.py test/test_forbidden_request.py test/test_list_message_direction_enum.py From 327e4cb9802ea760145591ac41ea2a6390f6e0b6 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Thu, 4 Aug 2022 16:58:14 -0400 Subject: [PATCH 03/10] push what i have rn --- test/integration/test_webrtc_api.py | 95 +++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 25 deletions(-) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index 548e5231..5b266217 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -9,6 +9,7 @@ """ +from array import array import os import unittest @@ -20,6 +21,7 @@ from bandwidth.model.publish_permissions_enum import PublishPermissionsEnum from bandwidth.model.device_api_version_enum import DeviceApiVersionEnum from bandwidth.model.participant import Participant +from bandwidth.model.session import Session class TestSessionsApi(unittest.TestCase): @@ -36,28 +38,54 @@ def setUp(self): self.participants_api_instance = participants_api.ParticipantsApi(api_client) self.account_id = os.environ.get('BW_ACCOUNT_ID') - def test_create_participant(self): - create_participant_request = CreateParticipantRequest( - callback_url="https://example.com/callback", - publish_permissions=[ + # Participant Properties + self.callback_url = 'https://example.com/callback' + self.publish_permissions = [ PublishPermissionsEnum('AUDIO'), PublishPermissionsEnum('VIDEO') - ], - tag="participant1", - device_api_version=DeviceApiVersionEnum("V3"), + ] + self.participant_tag = 'python integration participant tag' + self.device_api_version = DeviceApiVersionEnum('V3') + self.participant_id = '' + + # Participant Request + self.create_participant_request = CreateParticipantRequest( + callback_url=self.callback_url, + publish_permissions=self.publish_permissions, + tag=self.participant_tag, + device_api_version=self.device_api_version ) - response = self.participants_api_instance.create_participant(self.account_id, create_participant_request=create_participant_request, _return_http_data_only=False) - self.assertEqual(response[1], 200) - assert_that + # Session Properties + self.session_tag = 'python integration session tag' + self.session_id = '' - api_response = response[0] - self.assertIsInstance(api_response, CreateParticipantResponse) - self.assertIsInstance(api_response.participant, Participant) - print(api_response.participant['callback_url']) - self.assertEqual(api_response.participant.callback_url, create_participant_request.callback_url) - #self.assertEqual(api_response.publish_permissions, create_participant_request.publish_permissions) + # Session Request + self.session = Session( + tag=self.session_tag + ) + def test_create_participant(self): + response = self.participants_api_instance.create_participant(self.account_id, create_participant_request=self.create_participant_request, _return_http_data_only=False) + + assert_that(response[1], equal_to(200)) + + assert_that(response[0], instance_of(CreateParticipantResponse)) + assert_that(response[0], has_properties( + 'participant', instance_of(Participant), + 'participant', has_properties( + 'device_api_version', self.device_api_version, + 'id', instance_of(str), + 'publish_permissions', contains_inanyorder( + PublishPermissionsEnum('AUDIO'), + PublishPermissionsEnum('VIDEO')), + 'tag', self.participant_tag + ), + 'token', instance_of(str) + )) + + self.participant_id = response[0].participant.id + def test_delete_participant(self): """Test case for delete_participant @@ -73,18 +101,24 @@ def test_get_participant(self): pass def test_add_participant_to_session(self): - """Test case for add_participant_to_session + response = self.sessions_api_instance.add_participant_to_session(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) - Add Participant to Session # noqa: E501 - """ - pass + assert_that(response[1], 205) def test_create_session(self): - """Test case for create_session + response = self.sessions_api_instance.create_session(self.account_id, session=self.session, _return_http_data_only=False) - Create Session # noqa: E501 - """ - pass + assert_that(response[1], equal_to(200)) + + assert_that(response[0], instance_of(Session)) + assert_that(response[0], has_properties( + 'id', instance_of(str), + 'tag', self.session_tag, + 'participant_ids', instance_of(array), + 'participant_ids', empty() + )) + + self.session_id = response[0].id def test_delete_session(self): """Test case for delete_session @@ -129,5 +163,16 @@ def test_update_participant_subscriptions(self): pass + def _steps(self) -> None: + call_order = ['test_create_participant', 'test_create_session', 'test_add_participant_to_session', 'test_get_session'] + for name in call_order: + yield name, getattr(self, name) + + def test_steps(self) -> None: + """Test each function from _steps.call_order in specified order + """ + for name, step in self._steps(): + step() + if __name__ == '__main__': - unittest.main() + unittest.main() \ No newline at end of file From e43f6e86fd00667a0b1c4d7b30b7777e85a69f99 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Thu, 4 Aug 2022 18:03:53 -0400 Subject: [PATCH 04/10] most of happy path done --- test/integration/test_webrtc_api.py | 117 ++++++++++++++++++++-------- 1 file changed, 83 insertions(+), 34 deletions(-) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index 5b266217..87db3de3 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -12,6 +12,7 @@ from array import array import os import unittest +from urllib import response import bandwidth from hamcrest import * @@ -22,6 +23,8 @@ from bandwidth.model.device_api_version_enum import DeviceApiVersionEnum from bandwidth.model.participant import Participant from bandwidth.model.session import Session +from bandwidth.model.subscriptions import Subscriptions +from bandwidth.model.participant_subscription import ParticipantSubscription class TestSessionsApi(unittest.TestCase): @@ -65,7 +68,9 @@ def setUp(self): tag=self.session_tag ) - def test_create_participant(self): + self.stream_aliases = ['python integration alias'] + + def create_participant(self): response = self.participants_api_instance.create_participant(self.account_id, create_participant_request=self.create_participant_request, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -86,26 +91,38 @@ def test_create_participant(self): self.participant_id = response[0].participant.id - def test_delete_participant(self): + def delete_participant(self): """Test case for delete_participant Delete Participant # noqa: E501 """ pass - def test_get_participant(self): - """Test case for get_participant + def get_participant(self): + response = self.participants_api_instance.get_participant(self.account_id, self.participant_id, _return_http_data_only=False) - Get Participant # noqa: E501 - """ - pass + assert_that(response[1], equal_to(200)) + assert_that(response[0], instance_of(Participant)) + assert_that(response[0], has_properties( + 'device_api_version', self.device_api_version, + 'id', self.participant_id, + 'publish_permissions', contains_inanyorder( + PublishPermissionsEnum('AUDIO'), + PublishPermissionsEnum('VIDEO')), + 'sessions', [self.session_id], + 'subscriptions', has_properties( + 'participants', instance_of(list) + ), + 'tag', self.participant_tag + )) - def test_add_participant_to_session(self): + def add_participant_to_session(self): response = self.sessions_api_instance.add_participant_to_session(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) - assert_that(response[1], 205) + assert_that(response[1], equal_to(204)) + - def test_create_session(self): + def create_session(self): response = self.sessions_api_instance.create_session(self.account_id, session=self.session, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -120,51 +137,83 @@ def test_create_session(self): self.session_id = response[0].id - def test_delete_session(self): + def delete_session(self): """Test case for delete_session Delete Session # noqa: E501 """ pass - def test_get_participant_subscriptions(self): - """Test case for get_participant_subscriptions + def get_participant_subscriptions(self): + response = self.sessions_api_instance.get_participant_subscriptions(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) - Get Participant Subscriptions # noqa: E501 - """ - pass + assert_that(response[1], equal_to(200)) - def test_get_session(self): - """Test case for get_session + assert_that(response[0], has_properties( + 'participants', instance_of(list), + 'session_id', self.session_id + )) + assert_that(response[0].participants[0], instance_of(ParticipantSubscription)) + assert_that(response[0].participants[0], has_properties( + 'participant_id', self.participant_id, + 'stream_aliases', self.stream_aliases + )) - Get Session # noqa: E501 - """ - pass + def get_session(self): + response = self.sessions_api_instance.get_session(self.account_id, self.session_id, _return_http_data_only=False) - def test_list_session_participants(self): - """Test case for list_session_participants + assert_that(response[1], equal_to(200)) - List Participants in Session # noqa: E501 - """ - pass + assert_that(response[0], has_properties( + 'id', self.session_id, + 'tag', self.session_tag, + 'participant_ids', contains_exactly(self.participant_id) + )) - def test_remove_participant_from_session(self): + def list_session_participants(self): + response = self.sessions_api_instance.list_session_participants(self.account_id, self.session_id, _return_http_data_only=False) + + assert_that(response[1], equal_to(200)) + + assert_that(response[0], instance_of(list)) + assert_that(response[0][0], instance_of(Participant)) + assert_that(response[0][0], has_properties( + 'device_api_version', self.device_api_version, + 'id', self.participant_id, + 'publish_permissions', contains_inanyorder( + PublishPermissionsEnum('AUDIO'), + PublishPermissionsEnum('VIDEO')), + 'sessions', [self.session_id], + 'tag', self.participant_tag + )) + + def remove_participant_from_session(self): """Test case for remove_participant_from_session Remove Participant from Session # noqa: E501 """ pass - def test_update_participant_subscriptions(self): - """Test case for update_participant_subscriptions + def update_participant_subscriptions(self): + subscriptions = Subscriptions( + session_id=self.session_id, + participants=[ + ParticipantSubscription( + participant_id=self.participant_id, + stream_aliases=self.stream_aliases, + ) + ], + ) - Update Participant Subscriptions # noqa: E501 - """ - pass + response = self.sessions_api_instance.update_participant_subscriptions(self.account_id, self.session_id, self.participant_id, subscriptions=subscriptions, _return_http_data_only=False) + assert_that(response[1], equal_to(204)) def _steps(self) -> None: - call_order = ['test_create_participant', 'test_create_session', 'test_add_participant_to_session', 'test_get_session'] + call_order = ['create_participant', 'create_session', 'add_participant_to_session', + 'get_session', 'list_session_participants', 'update_participant_subscriptions', + 'get_participant_subscriptions', 'get_participant', 'remove_participant_from_session', + 'delete_session', 'delete_participant'] for name in call_order: yield name, getattr(self, name) @@ -175,4 +224,4 @@ def test_steps(self) -> None: step() if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() From 223d3b533a59bad84f431a8c665ebbe2e6137185 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Fri, 5 Aug 2022 12:07:41 -0400 Subject: [PATCH 05/10] happy path done --- test/integration/test_webrtc_api.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index 87db3de3..02fbd79a 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -92,11 +92,9 @@ def create_participant(self): self.participant_id = response[0].participant.id def delete_participant(self): - """Test case for delete_participant + response = self.participants_api_instance.delete_participant(self.account_id, self.participant_id, _return_http_data_only=False) - Delete Participant # noqa: E501 - """ - pass + assert_that(response[1], equal_to(204)) def get_participant(self): response = self.participants_api_instance.get_participant(self.account_id, self.participant_id, _return_http_data_only=False) @@ -138,11 +136,9 @@ def create_session(self): self.session_id = response[0].id def delete_session(self): - """Test case for delete_session + response = self.sessions_api_instance.delete_session(self.account_id, self.session_id, _return_http_data_only=False) - Delete Session # noqa: E501 - """ - pass + assert_that(response[1], equal_to(204)) def get_participant_subscriptions(self): response = self.sessions_api_instance.get_participant_subscriptions(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) @@ -188,11 +184,9 @@ def list_session_participants(self): )) def remove_participant_from_session(self): - """Test case for remove_participant_from_session + response = self.sessions_api_instance.remove_participant_from_session(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) - Remove Participant from Session # noqa: E501 - """ - pass + assert_that(response[1], equal_to(204)) def update_participant_subscriptions(self): subscriptions = Subscriptions( From 38c19370c5e41651139c2c53329b1891f049a7c4 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Fri, 5 Aug 2022 12:37:51 -0400 Subject: [PATCH 06/10] add notFound and unauthorized exception assertions --- test/integration/test_webrtc_api.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index 02fbd79a..4aee6eac 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -17,6 +17,7 @@ import bandwidth from hamcrest import * from bandwidth.api import participants_api, sessions_api +from bandwidth.exceptions import NotFoundException, UnauthorizedException from bandwidth.model.create_participant_request import CreateParticipantRequest from bandwidth.model.create_participant_response import CreateParticipantResponse from bandwidth.model.publish_permissions_enum import PublishPermissionsEnum @@ -203,11 +204,22 @@ def update_participant_subscriptions(self): assert_that(response[1], equal_to(204)) + def get_participant_unauthorized(self): + unauthorized_api_client = bandwidth.ApiClient() + unauthorized_participants_api_instance = participants_api.ParticipantsApi(unauthorized_api_client) + + assert_that(calling(unauthorized_participants_api_instance.get_participant).with_args( + self.account_id, self.participant_id, _return_http_data_only=False)), raises(UnauthorizedException) + + def get_participant_not_found(self): + assert_that(calling(self.participants_api_instance.get_participant).with_args( + self.account_id, self.participant_id)), raises(NotFoundException) + def _steps(self) -> None: call_order = ['create_participant', 'create_session', 'add_participant_to_session', 'get_session', 'list_session_participants', 'update_participant_subscriptions', 'get_participant_subscriptions', 'get_participant', 'remove_participant_from_session', - 'delete_session', 'delete_participant'] + 'delete_session', 'delete_participant', 'get_participant_unauthorized', 'get_participant_not_found'] for name in call_order: yield name, getattr(self, name) From 8b7203b9b91650561acc23d4ac20066970f92404 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Tue, 9 Aug 2022 13:50:41 -0400 Subject: [PATCH 07/10] add docstrings --- test/integration/test_webrtc_api.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index 4aee6eac..fa616056 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -72,6 +72,8 @@ def setUp(self): self.stream_aliases = ['python integration alias'] def create_participant(self): + """Test creating participant + """ response = self.participants_api_instance.create_participant(self.account_id, create_participant_request=self.create_participant_request, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -93,11 +95,15 @@ def create_participant(self): self.participant_id = response[0].participant.id def delete_participant(self): + """Test deleting participant + """ response = self.participants_api_instance.delete_participant(self.account_id, self.participant_id, _return_http_data_only=False) assert_that(response[1], equal_to(204)) def get_participant(self): + """Test getting participant + """ response = self.participants_api_instance.get_participant(self.account_id, self.participant_id, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -116,12 +122,16 @@ def get_participant(self): )) def add_participant_to_session(self): + """Test adding participant to session + """ response = self.sessions_api_instance.add_participant_to_session(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) assert_that(response[1], equal_to(204)) def create_session(self): + """Test creating session + """ response = self.sessions_api_instance.create_session(self.account_id, session=self.session, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -137,11 +147,15 @@ def create_session(self): self.session_id = response[0].id def delete_session(self): + """Test deleting session + """ response = self.sessions_api_instance.delete_session(self.account_id, self.session_id, _return_http_data_only=False) assert_that(response[1], equal_to(204)) def get_participant_subscriptions(self): + """Test getting participant subscriptions + """ response = self.sessions_api_instance.get_participant_subscriptions(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -157,6 +171,8 @@ def get_participant_subscriptions(self): )) def get_session(self): + """Test getting session + """ response = self.sessions_api_instance.get_session(self.account_id, self.session_id, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -168,6 +184,8 @@ def get_session(self): )) def list_session_participants(self): + """Test listing session participants + """ response = self.sessions_api_instance.list_session_participants(self.account_id, self.session_id, _return_http_data_only=False) assert_that(response[1], equal_to(200)) @@ -185,11 +203,15 @@ def list_session_participants(self): )) def remove_participant_from_session(self): + """Test removing participant from session + """ response = self.sessions_api_instance.remove_participant_from_session(self.account_id, self.session_id, self.participant_id, _return_http_data_only=False) assert_that(response[1], equal_to(204)) def update_participant_subscriptions(self): + """Test updating participant subscriptions + """ subscriptions = Subscriptions( session_id=self.session_id, participants=[ @@ -205,6 +227,8 @@ def update_participant_subscriptions(self): assert_that(response[1], equal_to(204)) def get_participant_unauthorized(self): + """Test getting participant with unauthorized API client + """ unauthorized_api_client = bandwidth.ApiClient() unauthorized_participants_api_instance = participants_api.ParticipantsApi(unauthorized_api_client) @@ -212,6 +236,8 @@ def get_participant_unauthorized(self): self.account_id, self.participant_id, _return_http_data_only=False)), raises(UnauthorizedException) def get_participant_not_found(self): + """Test getting nonexistent participant + """ assert_that(calling(self.participants_api_instance.get_participant).with_args( self.account_id, self.participant_id)), raises(NotFoundException) From e56f4412329c736075fdd75b1a5e065735698639 Mon Sep 17 00:00:00 2001 From: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:54:06 -0400 Subject: [PATCH 08/10] Update test/integration/test_webrtc_api.py Co-authored-by: AJ Rice <53190766+ajrice6713@users.noreply.github.com> --- test/integration/test_webrtc_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index fa616056..f35c948c 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -9,13 +9,14 @@ """ -from array import array import os import unittest +from array import array from urllib import response -import bandwidth from hamcrest import * + +import bandwidth from bandwidth.api import participants_api, sessions_api from bandwidth.exceptions import NotFoundException, UnauthorizedException from bandwidth.model.create_participant_request import CreateParticipantRequest From fa481eadb9f3120d599e57abf826593dcf888464 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Fri, 12 Aug 2022 14:42:24 -0400 Subject: [PATCH 09/10] use env_vars util --- test/integration/test_webrtc_api.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/integration/test_webrtc_api.py b/test/integration/test_webrtc_api.py index fa616056..61367389 100644 --- a/test/integration/test_webrtc_api.py +++ b/test/integration/test_webrtc_api.py @@ -10,9 +10,7 @@ from array import array -import os import unittest -from urllib import response import bandwidth from hamcrest import * @@ -26,6 +24,7 @@ from bandwidth.model.session import Session from bandwidth.model.subscriptions import Subscriptions from bandwidth.model.participant_subscription import ParticipantSubscription +from test.utils.env_variables import * class TestSessionsApi(unittest.TestCase): @@ -34,13 +33,13 @@ class TestSessionsApi(unittest.TestCase): def setUp(self): # API Client configuration = bandwidth.Configuration( - username = os.environ.get('BW_USERNAME'), - password = os.environ.get('BW_PASSWORD') + username = BW_USERNAME, + password = BW_PASSWORD ) api_client = bandwidth.ApiClient(configuration) self.sessions_api_instance = sessions_api.SessionsApi(api_client) self.participants_api_instance = participants_api.ParticipantsApi(api_client) - self.account_id = os.environ.get('BW_ACCOUNT_ID') + self.account_id = BW_ACCOUNT_ID # Participant Properties self.callback_url = 'https://example.com/callback' From 76feec2f9e06796400081386998ba80db4fc5bb5 Mon Sep 17 00:00:00 2001 From: Cameron Koegel Date: Fri, 12 Aug 2022 14:48:39 -0400 Subject: [PATCH 10/10] fix gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 43995bd4..3ea0fbac 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ __pycache__/ # C extensions *.so +# MacOS Files +.DS_Store + # Distribution / packaging .Python env/ @@ -64,3 +67,9 @@ target/ #Ipython Notebook .ipynb_checkpoints + +# VS Code +.vscode + +# Test Fixtures +test/fixtures/