def test_api_gateway_handler(self, mock_process_payload): event = { 'foo': 'bar' } lambda_api_handler(event) mock_process_payload.assert_called_with('{"foo": "bar"}', {'source': 'gateway'})
def test_lambda_api_handler_error(self, mock_logging, mock_FSM): event = {'foo': 'bar'} context = {'gateway': 'context'} mock_FSM.return_value.create_FSM_instance.side_effect = Exception() lambda_api_handler(event, context) mock_logging.exception.assert_called_with( 'Critical error handling lambda: %s', '[REDACTED]')