"""Integration test for general notifications.""" import pytest @pytest.mark.parametrize('sqs_message_fixture_name, expected_files, expected_message', ( pytest.param('sqs_object_host_read_ad_assigned', 1, ( 'From: The Orchard Podcasts ', 'Subject: [Host-Read Ad] A request has been assigned to you' ), id='sqs_object_host_read_ad_assigned'), )) def test_general_notifications( sqs_message_fixture_name, expected_files, expected_message, sqs_client, s3_client, request ): """Test general notifications flow.""" sqs_message = request.getfixturevalue(sqs_message_fixture_name) response = sqs_client.send_general_notification_message(sqs_message) assert response['ResponseMetadata']['HTTPStatusCode'] == 200 listed_files = s3_client.wait_for_files(expected_files) assert len(listed_files) == expected_files for key in listed_files: message = s3_client.get_file(key) for piece in expected_message: assert piece in message