docstr: Test getting command telemetry via _get_command_telemetry.
docstr_tok: ["Test","getting","command","telemetry","via","_get_command_telemetry","."]
code: def test_get_command_telemetry(self):
      """Test getting command telemetry via _get_command_telemetry."""
      # Test with dataframe command:
      command_metadata = metrics_util._get_command_telemetry(
          st.dataframe, "dataframe", pd.DataFrame(), width=250
      )
  
      self.assertEqual(command_metadata.name, "dataframe")
      self.assertEqual(len(command_metadata.args), 2)
      self.assertEqual(
          str(command_metadata.args[0]).strip(),
          'k: "data"\nt: "DataFrame"\nm: "len:0"',
      )
      self.assertEqual(
          str(command_metadata.args[1]).strip(),
          'k: "width"\nt: "int"',
      )
  
      # Test with text_input command:
      command_metadata = metrics_util._get_command_telemetry(
          st.text_input,
          "text_input",
          label="text input",
          value="foo",
          disabled=True,
      )
  
      self.assertEqual(command_metadata.name, "text_input")
      self.assertEqual(len(command_metadata.args), 3)
      self.assertEqual(
          str(command_metadata.args[0]).strip(),
          'k: "label"\nt: "str"\nm: "len:10"',
      )
      self.assertEqual(
          str(command_metadata.args[1]).strip(),
          'k: "value"\nt: "str"\nm: "len:3"',
      )
      self.assertEqual(
          str(command_metadata.args[2]).strip(),
          'k: "disabled"\nt: "bool"\nm: "val:True"',
      )
  
imports: import contextlib
  import datetime
  import unittest
  from collections import Counter
  from typing import Any, Callable
  from unittest.mock import MagicMock, mock_open, patch
  import pandas
  from parameterized import parameterized
  import streamlit
  import streamlit.components.v1
  from streamlit.connections import SnowparkConnection, SQLConnection
  from streamlit.runtime import metrics_util
  from streamlit.runtime.caching import cache_data_api, cache_resource_api
  from streamlit.runtime.legacy_caching import caching
  from streamlit.runtime.scriptrunner import get_script_run_ctx, magic_funcs
  from streamlit.web.server import websocket_headers
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 3 for calling the PageTelemetryTest obj's underlying member method code with example usage: obj.test_get_command_telemetry() without return types