diff --git a/sinch/core/clients/sinch_client_configuration.py b/sinch/core/clients/sinch_client_configuration.py index 9f69870..9cc89a1 100644 --- a/sinch/core/clients/sinch_client_configuration.py +++ b/sinch/core/clients/sinch_client_configuration.py @@ -88,7 +88,6 @@ def _set_sms_domain_with_service_plan_id(self, domain): def _get_sms_domain_with_service_plan_id(self): return self._sms_domain_with_service_plan_id - sms_domain_with_service_plan_id = property( _get_sms_domain_with_service_plan_id, _set_sms_domain_with_service_plan_id, diff --git a/tests/e2e/conversation/contact/test_merge_contacts.py b/tests/e2e/conversation/contact/test_merge_contacts.py index be1d189..bf1279e 100644 --- a/tests/e2e/conversation/contact/test_merge_contacts.py +++ b/tests/e2e/conversation/contact/test_merge_contacts.py @@ -1,4 +1,7 @@ -from sinch.domains.conversation.models.contact.responses import MergeConversationContactsResponse, ListConversationContactsResponse +from sinch.domains.conversation.models.contact.responses import ( + MergeConversationContactsResponse, + ListConversationContactsResponse +) def test_merge_contacts(sinch_client_sync): diff --git a/tests/e2e/sms/batches/test_batch_sms.py b/tests/e2e/sms/batches/test_batch_sms.py index e5531a7..af03d36 100644 --- a/tests/e2e/sms/batches/test_batch_sms.py +++ b/tests/e2e/sms/batches/test_batch_sms.py @@ -3,7 +3,6 @@ from sinch.domains.sms.models.batches.responses import SendSMSBatchResponse - @pytest.mark.skip() def test_send_sms_zen_of_python(sinch_client_sync, phone_number, origin_phone_number): zen = """ diff --git a/tests/e2e/sms/batches/test_get_batch.py b/tests/e2e/sms/batches/test_get_batch.py index e99da9d..7e0d872 100644 --- a/tests/e2e/sms/batches/test_get_batch.py +++ b/tests/e2e/sms/batches/test_get_batch.py @@ -18,6 +18,7 @@ def test_get_sms_batch_with_service_plan_id(sinch_client_sync): ) assert isinstance(get_batch_response, GetSMSBatchResponse) + async def test_get_sms_batch_async(sinch_client_async): list_batch_response = await sinch_client_async.sms.batches.list() get_batch_response = await sinch_client_async.sms.batches.get( diff --git a/tests/e2e/sms/batches/test_send_delivery_feedback.py b/tests/e2e/sms/batches/test_send_delivery_feedback.py index a3449a7..240734b 100644 --- a/tests/e2e/sms/batches/test_send_delivery_feedback.py +++ b/tests/e2e/sms/batches/test_send_delivery_feedback.py @@ -1,3 +1,4 @@ +from sinch.core.enums import HTTPAuthentication from sinch.domains.sms.models.batches.responses import SendSMSDeliveryFeedbackResponse @@ -13,6 +14,16 @@ def test_send_delivery_feedback(sinch_client_sync, phone_number): assert isinstance(delivery_feedback_response, SendSMSDeliveryFeedbackResponse) +def test_send_delivery_feedback_with_service_plan_id(sinch_client_sync, phone_number): + sinch_client_sync.configuration.sms_authentication_method = HTTPAuthentication.SMS_TOKEN.value + list_batches_response = sinch_client_sync.sms.batches.list() + delivery_feedback_response = sinch_client_sync.sms.batches.send_delivery_feedback( + batch_id=list_batches_response.result.batches[0].id, + recipients=[phone_number] + ) + assert isinstance(delivery_feedback_response, SendSMSDeliveryFeedbackResponse) + + async def test_send_delivery_feedback_async(sinch_client_async, phone_number): list_batches_response = await sinch_client_async.sms.batches.list( start_date="2019-08-24T14:15:22Z", diff --git a/tests/e2e/sms/batches/test_update_batch.py b/tests/e2e/sms/batches/test_update_batch.py index 96a4695..dc32379 100644 --- a/tests/e2e/sms/batches/test_update_batch.py +++ b/tests/e2e/sms/batches/test_update_batch.py @@ -1,6 +1,29 @@ +from sinch.core.enums import HTTPAuthentication from sinch.domains.sms.models.batches.responses import UpdateSMSBatchResponse +def test_update_sms_batch_with_service_plan_id( + sinch_client_sync, + phone_number, + origin_phone_number +): + sinch_client_sync.configuration.sms_authentication_method = HTTPAuthentication.SMS_TOKEN.value + send_batch_response = sinch_client_sync.sms.batches.send( + delivery_report="none", + to=[phone_number], + from_=origin_phone_number, + body="Update Batch Test", + feedback_enabled=True, + send_at="2024-12-01T21:37:00Z" + ) + update_batch_response = sinch_client_sync.sms.batches.update( + batch_id=send_batch_response.id, + body="Update Batch Test After Update" + ) + assert isinstance(update_batch_response, UpdateSMSBatchResponse) + assert update_batch_response.body == "Update Batch Test After Update" + + def test_update_sms_batch(sinch_client_sync, phone_number, origin_phone_number): send_batch_response = sinch_client_sync.sms.batches.send( delivery_report="none", diff --git a/tests/e2e/sms/delivery_reports/test_get_delivery_reports_for_project.py b/tests/e2e/sms/delivery_reports/test_get_delivery_reports_for_project.py index 28c4dc0..23bd987 100644 --- a/tests/e2e/sms/delivery_reports/test_get_delivery_reports_for_project.py +++ b/tests/e2e/sms/delivery_reports/test_get_delivery_reports_for_project.py @@ -8,6 +8,7 @@ def test_get_delivery_reports_for_project(sinch_client_sync): ) assert isinstance(list_delivery_reports_response.result, ListSMSDeliveryReportsResponse) + def test_get_delivery_reports_for_project_with_service_plan_id(sinch_client_sync): sinch_client_sync.configuration.sms_authentication_method = HTTPAuthentication.SMS_TOKEN.value list_delivery_reports_response = sinch_client_sync.sms.delivery_reports.list( @@ -15,6 +16,7 @@ def test_get_delivery_reports_for_project_with_service_plan_id(sinch_client_sync ) assert isinstance(list_delivery_reports_response.result, ListSMSDeliveryReportsResponse) + async def test_get_delivery_reports_for_project_async(sinch_client_async): list_delivery_reports_response = await sinch_client_async.sms.delivery_reports.list() assert isinstance(list_delivery_reports_response.result, ListSMSDeliveryReportsResponse) diff --git a/tests/e2e/sms/groups/test_create_group.py b/tests/e2e/sms/groups/test_create_group.py index d2f2b7b..d132039 100644 --- a/tests/e2e/sms/groups/test_create_group.py +++ b/tests/e2e/sms/groups/test_create_group.py @@ -1,6 +1,7 @@ from sinch.domains.sms.models.groups.responses import CreateSMSGroupResponse from sinch.core.enums import HTTPAuthentication + def test_create_sms_group(sinch_client_sync, phone_number): create_group_response = sinch_client_sync.sms.groups.create( name="KillerRabbit", diff --git a/tests/e2e/sms/groups/test_get_group.py b/tests/e2e/sms/groups/test_get_group.py index b9e605b..a063b47 100644 --- a/tests/e2e/sms/groups/test_get_group.py +++ b/tests/e2e/sms/groups/test_get_group.py @@ -11,6 +11,7 @@ def test_get_sms_group_with_service_plan_id(sinch_client_sync): ) assert isinstance(get_group_response, GetSMSGroupResponse) + def test_get_sms_group(sinch_client_sync): list_group_response = sinch_client_sync.sms.groups.list() @@ -19,6 +20,7 @@ def test_get_sms_group(sinch_client_sync): ) assert isinstance(get_group_response, GetSMSGroupResponse) + async def test_get_sms_group_async(sinch_client_async): list_group_response = await sinch_client_async.sms.groups.list() diff --git a/tests/e2e/sms/groups/test_get_phone_numbers_for_group.py b/tests/e2e/sms/groups/test_get_phone_numbers_for_group.py index d115f48..eb6509f 100644 --- a/tests/e2e/sms/groups/test_get_phone_numbers_for_group.py +++ b/tests/e2e/sms/groups/test_get_phone_numbers_for_group.py @@ -13,6 +13,7 @@ def test_get_group_phone_numbers_sms_with_service_plan_id(sinch_client_sync): assert isinstance(get_group_response, SinchGetSMSGroupPhoneNumbersResponse) assert get_group_response.phone_numbers + def test_get_group_phone_numbers_sms(sinch_client_sync): list_group_response = sinch_client_sync.sms.groups.list()