async def test_run_input_file_outputs(
    tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
  """run_input_file should echo user & assistant messages and return a populated session."""
  recorder: List[str] = []

  def _echo(msg: str) -> None:
    recorder.append(msg)

  monkeypatch.setattr(click, "echo", _echo)

  input_json = {
      "state": {"foo": "bar"},
      "queries": ["hello world"],
  }
  input_path = tmp_path / "input.json"
  input_path.write_text(json.dumps(input_json))

  artifact_service = cli.InMemoryArtifactService()
  session_service = cli.InMemorySessionService()
  dummy_root = types.SimpleNamespace(name="root")

  session = await cli.run_input_file(
      app_name="app",
      user_id="user",
      root_agent=dummy_root,
      artifact_service=artifact_service,
      session_service=session_service,
      input_path=str(input_path),
  )

  assert session.state["foo"] == "bar"
  assert any("[user]:" in line for line in recorder)
  assert any("[assistant]:" in line for line in recorder)
run_input_file should echo user & assistant messages and return a populated session.
tests/unittests/cli/utils/test_cli.py