def test_run_cmd_overwrite_reject(
    monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
  """User rejecting overwrite should trigger click.Abort."""
  agent_name = "agent"
  agent_dir = tmp_path / agent_name
  agent_dir.mkdir()
  (agent_dir / "dummy.txt").write_text("dummy")

  monkeypatch.setattr(os, "getcwd", lambda: str(tmp_path))
  monkeypatch.setattr(os.path, "exists", lambda _p: True)
  monkeypatch.setattr(os, "listdir", lambda _p: ["dummy.txt"])
  monkeypatch.setattr(click, "confirm", lambda *a, **k: False)

  with pytest.raises(click.Abort):
    cli_create.run_cmd(
        agent_name,
        model="gemini-2.0-flash-001",
        google_api_key=None,
        google_cloud_project=None,
        google_cloud_region=None,
    )
User rejecting overwrite should trigger click.Abort.
tests/unittests/cli/utils/test_cli_create.py