def test_cli_exit_on_noinput_and_replay(mocker, cli_runner) -> None:
    """Test cli invocation fail if both `no-input` and `replay` flags passed."""
    mock_cookiecutter = mocker.patch(
        'cookiecutter.cli.cookiecutter', side_effect=cookiecutter
    )

    template_path = 'tests/fake-repo-pre/'
    result = cli_runner(template_path, '--no-input', '--replay', '-v')

    assert result.exit_code == 1

    expected_error_msg = (
        "You can not use both replay and no_input or extra_context at the same time."
    )

    assert expected_error_msg in result.output

    mock_cookiecutter.assert_called_once_with(
        template_path,
        None,
        True,
        replay=True,
        overwrite_if_exists=False,
        skip_if_file_exists=False,
        output_dir='.',
        config_file=None,
        default_config=False,
        extra_context=None,
        password=None,
        directory=None,
        accept_hooks=True,
        keep_project_on_failure=False,
    )
Test cli invocation fail if both `no-input` and `replay` flags passed.
tests/test_cli.py