code: def test_publish_heroku_requires_heroku(mock_which, tmp_path_factory):
      mock_which.return_value = False
      runner = CliRunner()
      os.chdir(tmp_path_factory.mktemp("runner"))
      with open("test.db", "w") as fp:
          fp.write("data")
      result = runner.invoke(cli.cli, ["publish", "heroku", "test.db"])
      assert result.exit_code == 1
      assert "Publishing to Heroku requires heroku" in result.output
  
file_path: datasette/tests/test_publish_heroku.py
imports: from click.testing import CliRunner
  from datasette import cli
  from unittest import mock
  import os
  import pathlib
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_publish_heroku_requires_heroku(mock_which, tmp_path_factory) without return types