"""Pytest config.""" from dataclasses import dataclass import json import os import typing from aws_lambda_powertools.utilities.typing.lambda_context import LambdaContext import pytest SAMPLE_EVENT_PATH = os.path.join( os.path.dirname(__file__), 'sample_events/sample_event.json' ) @pytest.fixture def sample_event() -> typing.Dict[str, typing.Any]: """Sample event fixture.""" with open(SAMPLE_EVENT_PATH, 'r') as f: sample: typing.Dict[str, typing.Any] = json.load(f) return sample @pytest.fixture def lambda_context() -> LambdaContext: """Test lambda context.""" @dataclass class LambdaContextMock: function_name: str = 'test' memory_limit_in_mb: int = 256 invoked_function_arn: str = ( 'arn:aws:lambda:eu-east-1:123456789012:function:test' ) aws_request_id: str = 'a8efef24-def7-442a-b312-738a4e1cd2e3' return LambdaContextMock() # type: ignore