class_docstr: Base class for async streamlit.server testing.
  
  Subclasses should patch 'streamlit.server.server.AppSession',
  to prevent AppSessions from being created, and scripts from
  being run. (Script running involves creating new threads, which
  interfere with other tests if not properly terminated.)
  
  See the "ServerTest" class for example usage.
class_docstr_tok: ["Base","class","for","async","streamlit.server","testing",".","Subclasses","should","patch","'streamlit.server.server.AppSession","'",",","to","prevent","AppSessions","from","being","created",",","and","scripts","from","being","run",".","(","Script","running","involves","creating","new","threads",",","which","interfere","with","other","tests","if","not","properly","terminated",".",")","See","the","``","ServerTest","''","class","for","example","usage","."]
docstr: Create a mock AppSession. Each mocked instance will have
  its own unique ID.
docstr_tok: ["Create","a","mock","AppSession",".","Each","mocked","instance","will","have","its","own","unique","ID","."]
code: def _create_mock_app_session(*args, **kwargs):
      """Create a mock AppSession. Each mocked instance will have
      its own unique ID."""
      mock_id = mock.PropertyMock(
          return_value=f"mock_id:{ServerTestCase._next_session_id}"
      )
      ServerTestCase._next_session_id += 1
  
      mock_session = mock.MagicMock(
          AppSession, autospec=True, *args, **kwargs
      )
      type(mock_session).id = mock_id
      return mock_session
  
file_path: streamlit/lib/tests/streamlit/web/server/server_test_case.py
imports: import urllib.parse
  from unittest import mock
  import tornado.testing
  import tornado.web
  import tornado.websocket
  from tornado.websocket import WebSocketClientConnection
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.runtime import Runtime
  from streamlit.runtime.app_session import AppSession
  from streamlit.web.server import Server
label_desc: Use image node_id 4 for calling the ServerTestCase obj's underlying member method code with example usage: obj._create_mock_app_session() and returns: mock_session