def test_load_config_bad_event(self): """AppConfig - Load config with a bad event""" # Remove one of the required keys from the state event = get_event(self._test_app_name) del event['destination_function_name'] AppConfig.load_config(event, get_mock_lambda_context(self._test_app_name))
def __init__(self, event, context): self._config = AppConfig.load_config(event, context) self._batcher = Batcher(self._config.function_name, self._config.destination_function) self._gathered_log_count = 0 self._more_to_poll = False self._poll_count = 0 self._last_timestamp = 0
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 test_get_parameters_bad_names(self, json_mock): """AppConfig - Get parameter, Bad Names""" _, invalid_names = AppConfig._get_parameters('bad_name') assert_equal(invalid_names[0], 'bad_name') json_mock.loads.assert_not_called()