def METHOD_NAME(
    self, mocker: MockerFixture, target_already_exists: bool, tmp_path: Path
) -> None:
    """Test install."""
    requirements_txt = tmp_path / "requirements.txt"
    target = tmp_path / "foo" / "bar"
    if target_already_exists:
        target.mkdir(parents=True)
    mock_generate_install_command = mocker.patch.object(
        Pip, "generate_install_command", return_value=["generate_install_command"]
    )
    mock_run_command = mocker.patch.object(
        Pip, "_run_command", return_value="_run_command"
    )
    assert (
        Pip(Mock(), tmp_path).install(
            extend_args=["--foo", "bar"],
            requirements=requirements_txt,
            target=target,
        )
        == target
    )
    assert target.is_dir(), "target directory and parents created"
    mock_generate_install_command.assert_called_once_with(
        cache_dir=None,
        no_cache_dir=False,
        no_deps=False,
        requirements=requirements_txt,
        target=target,
    )
    mock_run_command.assert_called_once_with(
        mock_generate_install_command.return_value + ["--foo", "bar"],
        suppress_output=False,
    )