def testHandlerExecFail(self, mock_dns: MagicMock, mock_myip: MagicMock, mock_script: MagicMock, mock_version: MagicMock): event = {'resource': '/foo', 'httpMethod': 'GET'} context = {} handle(event, context) mock_dns.assert_not_called() mock_myip.assert_not_called() mock_script.assert_not_called() mock_version.assert_not_called()
def testHandlerMyIP(self, mock_dns: MagicMock, mock_myip: MagicMock, mock_script: MagicMock, mock_version: MagicMock): event = {'resource': '/myip', 'httpMethod': 'GET'} context = {} handle(event, context) mock_dns.assert_not_called() mock_myip.assert_called_once_with(event, context) mock_script.assert_not_called() mock_version.assert_not_called()