class_docstr: Test st.write.
  
  Unit tests for https://docs.streamlit.io/library/api-reference/write-magic/st.write
  
  Because we're going to test st.markdown, st.pyplot, st.altair_chart
  later on, we don't have to test it in st.write In st.write, all we're
  trying to check is that the right st.* method gets called
class_docstr_tok: ["Test","st.write",".","Unit","tests","for","https",":","\/\/docs.streamlit.io\/library\/api-reference\/write-magic\/st.write","Because","we","'re","going","to","test","st.markdown",",","st.pyplot",",","st.altair_chart","later","on",",","we","do","n't","have","to","test","it","in","st.write","In","st.write",",","all","we're","trying","to","check","is","that","the","right","st.","*","method","gets","called"]
docstr: Test st.write with dataframe.
code: def test_dataframe(self):
      """Test st.write with dataframe."""
      data = {
          type_util._PANDAS_DF_TYPE_STR: pd.DataFrame(
              [[20, 30, 50]], columns=["a", "b", "c"]
          ),
          type_util._PANDAS_SERIES_TYPE_STR: pd.Series(
              np.array(["a", "b", "c"])
          ),
          type_util._PANDAS_INDEX_TYPE_STR: pd.Index(list("abc")),
          type_util._PANDAS_STYLER_TYPE_STR: pd.DataFrame(
              {"a": [1], "b": [2]}
          ).style.format("{:.2%}"),
          type_util._NUMPY_ARRAY_TYPE_STR: np.array(["a", "b", "c"]),
      }
  
      # Make sure we have test cases for all _DATAFRAME_LIKE_TYPES
      self.assertEqual(
          sorted(data.keys()), sorted(type_util._DATAFRAME_LIKE_TYPES)
      )
  
      for df in data.values():
          with patch(
              "streamlit.delta_generator.DeltaGenerator.dataframe"
          ) as p:
              st.write(df)
  
              p.assert_called_once()
  
imports: import dataclasses
  import time
  import unittest
  from collections import namedtuple
  from unittest.mock import Mock, PropertyMock, call, patch
  import numpy
  import pandas
  import pytest
  import streamlit
  from streamlit import type_util
  from streamlit.elements import write
  from streamlit.error_util import handle_uncaught_app_exception
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.state import QueryParamsProxy, SessionStateProxy
label_desc: Use image node_id 4 for calling the StreamlitWriteTest obj's underlying member method code with example usage: obj.test_dataframe() without return types