from aws_lambda_powertools.utilities.typing.lambda_context import LambdaContext
from layercake.dynamodb import DynamoDBPersistenceLayer

import events.check_mx_record as app


def test_check_mx_record(
    lambda_context: LambdaContext,
    dynamodb_persistence_layer: DynamoDBPersistenceLayer,
):
    event = {
        'detail': {
            'new_image': {
                'id': '123',
                'sk': 'emails#sergio@somosbeta.com.br',
            },
        },
    }

    assert app.lambda_handler(event, lambda_context)  # type: ignore
