Skip to content

Commit

Permalink
fix: style
Browse files Browse the repository at this point in the history
  • Loading branch information
650elx committed Jul 12, 2024
1 parent 07f4b98 commit 6c54253
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 3 deletions.
1 change: 0 additions & 1 deletion sinch/core/clients/sinch_client_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/conversation/contact/test_merge_contacts.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/sms/batches/test_batch_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/sms/batches/test_get_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 11 additions & 0 deletions tests/e2e/sms/batches/test_send_delivery_feedback.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from sinch.core.enums import HTTPAuthentication
from sinch.domains.sms.models.batches.responses import SendSMSDeliveryFeedbackResponse


Expand All @@ -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",
Expand Down
23 changes: 23 additions & 0 deletions tests/e2e/sms/batches/test_update_batch.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ 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(
start_date="2019-08-24T14:15:22Z"
)
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)
1 change: 1 addition & 0 deletions tests/e2e/sms/groups/test_create_group.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/sms/groups/test_get_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand Down
1 change: 1 addition & 0 deletions tests/e2e/sms/groups/test_get_phone_numbers_for_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 6c54253

Please sign in to comment.