def test_cli_accept_hooks(
    mocker,
    cli_runner,
    output_dir_flag,
    output_dir,
    accept_hooks_arg,
    user_input,
    expected,
) -> None:
    """Test cli invocation works with `accept-hooks` option."""
    mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")

    template_path = "tests/fake-repo-pre/"
    result = cli_runner(
        template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
    )

    assert result.exit_code == 0
    mock_cookiecutter.assert_called_once_with(
        template_path,
        None,
        False,
        replay=False,
        overwrite_if_exists=False,
        output_dir=output_dir,
        config_file=None,
        default_config=False,
        extra_context=None,
        password=None,
        directory=None,
        skip_if_file_exists=False,
        accept_hooks=expected,
        keep_project_on_failure=False,
    )
Test cli invocation works with `accept-hooks` option.
tests/test_cli.py