def test_handler(gather_mock): """StreamAlertApp Lambda - Test Handler""" app_type = 'duo_auth' event = get_event(app_type) put_mock_params(app_type) handler(event, get_mock_lambda_context(app_type)) gather_mock.assert_called_once()
def setup(self): """Setup before each method""" # pylint: disable=attribute-defined-outside-init self._test_app_name = 'aliyun' put_mock_params(self._test_app_name) self._event = get_event(self._test_app_name) self._context = get_mock_lambda_context(self._test_app_name, milliseconds=100000) self._app = AliyunApp(self._event, self._context)
def setup(self): """Setup before each method""" # pylint: disable=attribute-defined-outside-init self._test_app_name = 'test_app' put_mock_params(self._test_app_name) self._event = get_event(self._test_app_name) self._context = get_mock_lambda_context(self._test_app_name) self._config = AppConfig.load_config(self._event, self._context)
def setup(self): """Setup before each method""" # pylint: disable=attribute-defined-outside-init self._test_app_name = 'salesforce' put_mock_params(self._test_app_name) self._event = get_event(self._test_app_name) self._context = get_mock_lambda_context(self._test_app_name) self._app = SalesforceApp(self._event, self._context)
def setup(self): """Setup before each method""" # pylint: disable=abstract-class-instantiated,attribute-defined-outside-init self._test_app_name = 'test_app' put_mock_params(self._test_app_name) self._event = get_event(self._test_app_name) self._context = get_mock_lambda_context(self._test_app_name) self._app = AppIntegration(self._event, self._context)
def setup(self): """Setup before each method""" # pylint: disable=attribute-defined-outside-init self._test_app_name = 'gsuite_admin' put_mock_params(self._test_app_name) self._event = get_event(self._test_app_name) self._context = get_mock_lambda_context(self._test_app_name) self._app = GSuiteReportsApp(self._event, self._context)
def setup(self): """Setup before each method""" # pylint: disable=abstract-class-instantiated,attribute-defined-outside-init self._test_app_name = 'intercom' put_mock_params(self._test_app_name) self._event = get_event(self._test_app_name) self._context = get_mock_lambda_context(self._test_app_name) self._app = IntercomApp(self._event, self._context) self._app._config.auth['token'] = 'good_token' # nosec
def test_filter_entries_not_implemented(): """SlackApp - Subclass Filter Entries Not Implemented""" # pylint: disable=protected-access,abstract-method class SlackFakeApp(SlackApp): """Fake Slack app that should raise a NotImplementedError""" @classmethod def _type(cls): return 'fake' @classmethod def _endpoint(cls): return 0 app_name = 'fake' event = get_event(app_name) context = get_mock_lambda_context(app_name) context.function_name = app_name with patch.dict(os.environ, {'AWS_DEFAULT_REGION': 'us-east-1'}): put_mock_params(app_name) SlackFakeApp(event, context)._filter_response_entries("")