def agent_dir(tmp_path: Path) -> Callable[[bool], Path]:
  """Return a factory that creates a dummy agent directory tree."""

  def _factory(include_requirements: bool) -> Path:
    base = tmp_path / "agent"
    base.mkdir()
    (base / "agent.py").write_text("# dummy agent")
    (base / "__init__.py").touch()
    if include_requirements:
      (base / "requirements.txt").write_text("pytest\n")
    return base

  return _factory
Return a factory that creates a dummy agent directory tree.
tests/unittests/cli/utils/test_cli_deploy.py