"""Test handler.""" from unittest.mock import patch import index @patch('index.graphql_gateway.execute') def test_handler(mock_graphql_execute, payload): """Test the main handler.""" mock_graphql_execute.return_value = True response = index.handler(payload, None) assert response is True def test_construct_item(): """Test construct_item.""" item = index.construct_item( 23421, '3452452345432', '3452kl3kljll', 1, '2020-11-11' ) assert item == { 'productId': 23421, 'upc': '3452452345432', 'storeId': 1, 'storeInternalId': '3452kl3kljll', 'status': 'live', 'salesStartDate': '2020-11-11', 'storeInternalStatus': '', 'forcePolling': 0, 'receivedForPollingDate': 0, 'deliveryDate': 0, 'countryCodes': '', }