"""Lambda test module.""" from unittest.mock import patch from content_utils.exceptions import IneligibleEventError import pytest from src import app @patch('src.app.processing_logic') def test_handler_success(_, mock_event): """Test handler function.""" actual = app.handler(mock_event, None) assert actual == {'status': 'success'} @patch('src.app.processing_logic', side_effect=IneligibleEventError('foo')) def test_handler_skip(_, mock_event): """Test handler skip.""" actual = app.handler(mock_event, None) assert actual == {'status': 'skip'} @patch('src.app.processing_logic', side_effect=Exception('foo')) def test_handler_error(_, mock_event): """Test handler skip.""" with pytest.raises(Exception) as e: app.handler(mock_event, None) assert e.value.args[0] == 'foo'