code: def test_stop_server_not_running():
      """If the server is not running but stopped an Exception should be raised."""
      frontend = PanelFrontend(entry_point=Mock())
      with pytest.raises(RuntimeError, match="Server is not running."):
          frontend.stop_server()
  
imports: import os
  import runpy
  import sys
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from lightning.app import LightningFlow
  from lightning.app.frontend.panel import PanelFrontend, panel_serve_render_fn
  from lightning.app.frontend.panel.panel_frontend import _has_panel_autoreload
  from lightning.app.utilities.state import AppState
label_desc: Use image node_id 1 for calling a global function with example usage: test_stop_server_not_running() without return types