code: def test_python_server_component():
      port = find_free_network_port()
      process = mp.Process(target=target_fn, args=(port,))
      process.start()
      session = _configure_session()
      res = session.post(
          f"http://127.0.0.1:{port}/predict", json={"payload": "test"}
      )
      process.terminate()
      assert res.json()["prediction"] == "test"
      process.kill()
  
file_path: pytorch-lightning/tests/tests_app/components/serve/test_python_server.py
imports: import multiprocessing
  from lightning.app.components import Category, Image, Number, PythonServer, Text
  from lightning.app.utilities.network import _configure_session, find_free_network_port
label_desc: Use image node_id 2 for calling a global function with example usage: test_python_server_component() without return types