From b7a6f4a3ba8b531758c19bced797be19ed1e80db Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 1 Oct 2024 11:45:52 -0700 Subject: [PATCH] try fixing tests --- tests/app/delivery/test_send_to_providers.py | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/app/delivery/test_send_to_providers.py b/tests/app/delivery/test_send_to_providers.py index c9660c95d..1bfdaab0a 100644 --- a/tests/app/delivery/test_send_to_providers.py +++ b/tests/app/delivery/test_send_to_providers.py @@ -201,7 +201,7 @@ def test_should_not_send_sms_message_when_service_is_inactive_notification_is_in mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} with pytest.raises(NotificationTechnicalFailureException) as e: send_to_providers.send_sms_to_provider(sample_notification) @@ -232,7 +232,7 @@ def test_send_sms_should_use_template_version_from_notification_not_latest( mock_s3_p = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_s3_p.return_value = {} + mock_s3_p.return_value = {"ignore": "ignore"} mocker.patch("app.aws_sns_client.send_sms") @@ -286,7 +286,7 @@ def test_should_have_sending_status_if_fake_callback_function_fails( mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} sample_notification.key_type = KeyType.TEST with pytest.raises(HTTPError): @@ -311,7 +311,7 @@ def test_should_not_send_to_provider_when_status_is_not_created( mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} send_to_providers.send_sms_to_provider(notification) @@ -376,7 +376,7 @@ def test_send_sms_should_use_service_sms_sender( mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} send_to_providers.send_sms_to_provider( db_notification, @@ -408,7 +408,7 @@ def test_send_email_to_provider_should_not_send_to_provider_when_status_is_not_c mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} send_to_providers.send_sms_to_provider(notification) app.aws_ses_client.send_email.assert_not_called() app.delivery.send_to_providers.send_email_response.assert_not_called() @@ -672,7 +672,7 @@ def test_should_set_notification_billable_units_and_reduces_provider_priority_if mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} # flake8 no longer likes raises with a generic exception try: @@ -707,7 +707,7 @@ def test_should_send_sms_to_international_providers( mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} send_to_providers.send_sms_to_provider(notification_international) @@ -753,7 +753,7 @@ def test_should_handle_sms_sender_and_prefix_message( mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} send_to_providers.send_sms_to_provider(notification) @@ -814,7 +814,7 @@ def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_te mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore": "ignore"} send_to_providers.send_sms_to_provider(notification) send_mock.assert_called_once_with( to="12028675309", @@ -894,7 +894,7 @@ def test_send_sms_to_provider_should_return_template_if_found_in_redis( mock_personalisation = mocker.patch( "app.delivery.send_to_providers.get_personalisation_from_s3" ) - mock_personalisation.return_value = {} + mock_personalisation.return_value = {"ignore: ignore"} send_to_providers.send_sms_to_provider(notification) assert mock_get_template.called is False