docstr: Test MessageCache.clear
docstr_tok: ["Test","MessageCache.clear"]
code: def test_clear(self):
      """Test MessageCache.clear"""
      cache = ForwardMsgCache()
      session = _create_mock_session()
  
      msg = create_dataframe_msg([1, 2, 3])
      msg_hash = populate_hash_if_needed(msg)
  
      cache.add_message(msg, session, 0)
      self.assertEqual(msg, cache.get_message(msg_hash))
  
      cache.clear()
      self.assertEqual(None, cache.get_message(msg_hash))
  
imports: import unittest
  from unittest.mock import MagicMock
  from streamlit import config
  from streamlit.runtime import app_session
  from streamlit.runtime.forward_msg_cache import ForwardMsgCache, create_reference_msg, populate_hash_if_needed
  from streamlit.runtime.stats import CacheStat
  from streamlit.testing.v1.util import patch_config_options
  from tests.streamlit.message_mocks import create_dataframe_msg
label_desc: Use image node_id 6 for calling the ForwardMsgCacheTest obj's underlying member method code with example usage: obj.test_clear() without return types