def METHOD_NAME(
    mock_call, mock_check_output, mock_which, tmp_path_factory
):
    mock_which.return_value = True
    mock_check_output.side_effect = lambda s: {"['heroku', 'plugins']": b""}[repr(s)]
    runner = CliRunner()
    os.chdir(tmp_path_factory.mktemp("runner"))
    with open("t.db", "w") as fp:
        fp.write("data")
    result = runner.invoke(cli.cli, ["publish", "heroku", "t.db"], input="y\n")
    assert 0 != result.exit_code
    mock_check_output.assert_has_calls(
        [mock.call(["heroku", "plugins"]), mock.call(["heroku", "apps:list", "--json"])]
    )
    mock_call.assert_has_calls(
        [mock.call(["heroku", "plugins:install", "heroku-builds"])]
    )