class_docstr: Test ability to marshall form protos.
class_docstr_tok: ["Test","ability","to","marshall","form","protos","."]
docstr: Creating a form should result in the expected protobuf data.
code: def test_marshall_form(self):
      """Creating a form should result in the expected protobuf data."""
  
      # Test with clear_on_submit=True
      with st.form(key="foo", clear_on_submit=True):
          pass
  
      self.assertEqual(len(self.get_all_deltas_from_queue()), 1)
      form_proto = self.get_delta_from_queue(0).add_block
      self.assertEqual("foo", form_proto.form.form_id)
      self.assertEqual(True, form_proto.form.clear_on_submit)
      self.assertEqual(True, form_proto.form.border)
      self.clear_queue()
  
      # Test with clear_on_submit=False
      with st.form(key="bar", clear_on_submit=False):
          pass
  
      self.assertEqual(len(self.get_all_deltas_from_queue()), 1)
      form_proto = self.get_delta_from_queue(0).add_block
      self.assertEqual("bar", form_proto.form.form_id)
      self.assertEqual(False, form_proto.form.clear_on_submit)
  
imports: from unittest.mock import MagicMock, patch
  import streamlit
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.state.session_state import RegisterWidgetResult
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 1 for calling the FormMarshallingTest obj's underlying member method code with example usage: obj.test_marshall_form() without return types