def _config_callback(ctx, param, value): try: data = parse_config(value) config = process_config(data) except ConfigError as exc: error_echo('Could not load config file') error_echo(str(exc)) ctx.exit(1) else: config['verbosity'] = ctx.params['verbose'] config['debug'] = ctx.params['debug'] config['dry_run'] = ctx.params['dry_run'] return config
def test_error_echo(mocker): secho = mocker.patch('logstapo.util.click.secho') util.error_echo('test') assert secho.called