"""Fixtures for lambda testing.""" import json from pathlib import Path import boto3 import config import pytest @pytest.fixture() def sample_event() -> dict: """Load sample EventBridge event from JSON file.""" event_path = Path(__file__).parent.parent / "sample_event.json" with open(event_path) as f: return json.load(f) @pytest.fixture() def invoke_lambda(sample_event: dict): """Invoke the lambda function with sample event.""" client = boto3.client("lambda") return client.invoke( FunctionName=config.LAMBDA_NAME, InvocationType="RequestResponse", Payload=json.dumps(sample_event).encode(), )