"""Lambda test module.""" import pytest from owsrequest.utils import mock_request import config from src import app as index from src.app import BadRequest def test_handler_invalid_input(): """Test handler function.""" with pytest.raises(BadRequest): index.handler({'dummy': 'input'}, None) def test_handler_valid_input(): """Test handler function.""" event = { 'brand': 'awal', 'email': 'npatel+invite3@theorchard.com', 'identity_id': '2f97bf37-ad8b-487a-bfe6-f47aa7ec97dd', 'label_profile_id': '1234', } ows_result = {'foo': 'bar'} mock_request.any( config.OWS_SERVICE_NAME, config.OWS_SERVICE_ENDPOINT, ows_result) result = index.handler(event, {}) assert result assert result == ows_result