def test_should_send_sns_message(self, boto3_mock): sns_resource_mock = Mock() sns_topic_mock = Mock() boto3_mock.return_value = sns_resource_mock sns_resource_mock.Topic.return_value = sns_topic_mock notify(None, None, 'ANY_ARN', None) sns_topic_mock.publish.assert_called_once_with(Message='"MESSAGE"')
def send_update_message(self, invoker_role): credentials = self.assume_role(invoker_role) credentials_set(credentials) crassus_input_topic_arn = self.get_stack_output( self.crassus_stack_name, 'inputSnsTopicARN') back_channel_url = self.get_stack_output( self.crassus_stack_name, 'outputSqsQueue') run_seconds = 10 cleanup( back_channel_url, run_seconds, self.crassus_stack_name, REGION_NAME) result = notify( self.app_stack_name, 'dockerImageVersion=40', crassus_input_topic_arn, REGION_NAME) logger.info( 'published update message to topic: {0}, message: {1}, got ' 'message_id: {2}'.format( crassus_input_topic_arn, 'dockerImageVersion=40', result ))