code: def test_start_server_through_function(
      uvicorn_mock, tmpdir, monkeypatch, root_path
  ):
      FastAPIMock = MagicMock()
      FastAPIMock.mount = MagicMock()
      FastAPIGetDecoratorMock = MagicMock()
      FastAPIMock.get.return_value = FastAPIGetDecoratorMock
      monkeypatch.setattr(
          lightning.app.frontend.web,
          "FastAPI",
          MagicMock(return_value=FastAPIMock),
      )
  
      lightning.app.frontend.web._start_server(
          serve_dir=tmpdir,
          host="myhost",
          port=1000,
          path="/test-flow",
          root_path=root_path,
      )
      uvicorn_mock.run.assert_called_once_with(
          app=ANY,
          host="myhost",
          port=1000,
          log_config=ANY,
          root_path=root_path,
      )
  
      FastAPIMock.mount.assert_called_once_with(
          root_path or "/test-flow", ANY, name="static"
      )
      FastAPIMock.get.assert_called_once_with(
          "/test-flow/healthz", status_code=200
      )
  
      FastAPIGetDecoratorMock.assert_called_once_with(_healthz)
  
      # path has default value "/"
      FastAPIMock.mount = MagicMock()
      lightning.app.frontend.web._start_server(
          serve_dir=tmpdir,
          host="myhost",
          port=1000,
          root_path=root_path,
      )
      FastAPIMock.mount.assert_called_once_with(
          root_path or "/", ANY, name="static"
      )
  
file_path: pytorch-lightning/tests/tests_app/frontend/test_web.py
imports: import os
  from unittest import mock
  from unittest.mock import ANY, MagicMock
  import lightning.app
  import pytest
  from lightning.app import LightningFlow
  from lightning.app.frontend.web import StaticWebFrontend, _healthz
  from lightning.app.storage.path import _storage_root_dir
label_desc: Use image node_id 3 for calling a global function with example usage: test_start_server_through_function(uvicorn_mock, tmpdir, monkeypatch, root_path) without return types