"""Tests for SNS module.""" import json from unittest.mock import Mock from unittest.mock import patch import sns @patch('sns.boto3') def test_send_notification(boto3_mock): """Test send_notification function.""" expected_topic = 'topic' expected_message = { 'foo': 'bar' } client = Mock() boto3_mock.client.return_value = client sns.send_notification(expected_topic, expected_message) client.publish.assert_called_once_with( TopicArn=expected_topic, Message=json.dumps(expected_message))