docstr: Coalesce a non-null-WidgetStates rerun request with a
  null-WidgetStates request.
docstr_tok: ["Coalesce","a","non-null-WidgetStates","rerun","request","with","a","null-WidgetStates","request","."]
code: def test_rerun_coalesce_widgets_and_none(self):
      """Coalesce a non-null-WidgetStates rerun request with a
      null-WidgetStates request.
      """
      reqs = ScriptRequests()
  
      # Request a rerun with non-null WidgetStates.
      states = WidgetStates()
      _create_widget("trigger", states).trigger_value = True
      _create_widget("int", states).int_value = 123
      success = reqs.request_rerun(RerunData(widget_states=states))
      self.assertTrue(success)
  
      # Request a rerun with null WidgetStates.
      success = reqs.request_rerun(RerunData(widget_states=None))
      self.assertTrue(success)
  
      # The null WidgetStates request will be dropped; our existing
      # request should have the original values.
      result_states = reqs._rerun_data.widget_states
      self.assertEqual(
          True, _get_widget("trigger", result_states).trigger_value
      )
      self.assertEqual(123, _get_widget("int", result_states).int_value)
  
imports: import unittest
  from typing import Optional
  from streamlit.proto.WidgetStates_pb2 import WidgetState, WidgetStates
  from streamlit.runtime.scriptrunner.script_requests import RerunData, ScriptRequest, ScriptRequests, ScriptRequestType
label_desc: Use image node_id 7 for calling the ScriptRequestsTest obj's underlying member method code with example usage: obj.test_rerun_coalesce_widgets_and_none() without return types