def test_generate_files_permission_error(
    monkeypatch: pytest.MonkeyPatch, agent_folder: Path
) -> None:
  """PermissionError raised by os.makedirs should propagate."""
  monkeypatch.setattr(
      os, "makedirs", lambda *a, **k: (_ for _ in ()).throw(PermissionError())
  )
  with pytest.raises(PermissionError):
    cli_create._generate_files(str(agent_folder), model="gemini-2.0-flash-001")
PermissionError raised by os.makedirs should propagate.
tests/unittests/cli/utils/test_cli_create.py