def test_sqs_route_keep_message_translator(dummy_handler): route = SQSRoute("what", handler=dummy_handler, message_translator=SNSMessageTranslator()) assert isinstance(route.message_translator, SNSMessageTranslator) route = SQSRoute("what", handler=dummy_handler, message_translator=None) assert route.message_translator is None
def test_sqs_route(dummy_handler): route = SQSRoute("what", handler=dummy_handler) assert isinstance(route.message_translator, SQSMessageTranslator) assert isinstance(route.provider, SQSProvider) assert route.name == "what"
def test_sqs_route_provider_options(dummy_handler): route = SQSRoute("what", {"use_ssl": False}, handler=dummy_handler, name="foobar") assert "use_ssl" in route.provider._client_options assert route.provider._client_options["use_ssl"] is False
def test_sqs_route_keep_name(dummy_handler): route = SQSRoute("what", handler=dummy_handler, name="foobar") assert route.name == "foobar"
from loafer.ext.aws.routes import SQSRoute from .handlers import print_handler, error_handler from .settings import settings routes = (SQSRoute( settings.SQS_QUEUE_NAME, {'options': { 'WaitTimeSeconds': 3 }}, handler=print_handler, error_handler=error_handler, ), )
def test_sqs_route_provider_options(dummy_handler): route = SQSRoute('what', {'use_ssl': False}, handler=dummy_handler, name='foobar') assert 'use_ssl' in route.provider._client_options assert route.provider._client_options['use_ssl'] is False
def test_sqs_route_keep_name(dummy_handler): route = SQSRoute('what', handler=dummy_handler, name='foobar') assert route.name == 'foobar'
from loafer.ext.aws.routes import SQSRoute from .handlers import handler_add from .handlers import error_handler from decouple import config routes = ( SQSRoute(config('QUEUE_NAME', 'loafer-test'), {'options': {'WaitTimeSeconds': 3}}, handler=handler_add, error_handler=error_handler), )