code: def test_get_ws_url_when_local():
      """The websocket uses port APP_SERVER_PORT when local."""
      assert (
          _get_ws_url() == f"ws://localhost:{APP_SERVER_PORT}/api/v1/ws"
      )
  
file_path: pytorch-lightning/tests/tests_app/frontend/panel/test_app_state_comm.py
imports: import os
  from unittest import mock
  from lightning.app.core.constants import APP_SERVER_PORT
  from lightning.app.frontend.panel.app_state_comm import _get_ws_url, _run_callbacks, _watch_app_state
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_ws_url_when_local() without return types