class_docstr: Test class for Teams
class_docstr_tok: ["Test","class","for","Teams"]
docstr: TeamsOutput - Format Message - Buttons
docstr_tok: ["TeamsOutput","-","Format","Message","-","Buttons"]
code: def test_format_message_buttons(
      self, _, alert_section_mock, add_buttons_mock
  ):
      """TeamsOutput - Format Message - Buttons"""
      rule_name = "test_rule_default"
      alert = get_random_alert(25, rule_name)
      output = MagicMock(spec=TeamsOutput)
      alert_publication = compose_alert(alert, output, "asdf")
      alert_publication["@teams.with_record"] = False
  
      alert_section_mock.return_value = "Alert_Section"
      add_buttons_mock.side_effect = lambda teams_card, _: teams_card
  
      # Pass buttons in via publication
      buttons = [("button_text", "button_url")]
      alert_publication["@teams.buttons"] = buttons
  
      loaded_message = self._dispatcher._format_message(
          alert, alert_publication, self.CREDS["url"]
      )
  
      # Tests
  
      # Verify title
      loaded_message.title.assert_called()
      loaded_message.title.assert_called_with(
          "StreamAlert Rule Triggered: {}".format(alert.rule_name)
      )
  
      # Verify text/description
      loaded_message.text.assert_called()
      loaded_message.text.assert_called_with(alert.rule_description)
  
      # Verify card color
      loaded_message.color.assert_called()
      loaded_message.color.assert_called_with("E81123")
  
      # Verify Sections
      alert_section_mock.assert_called()
      alert_section_mock.assert_called_with(alert)
      loaded_message.addSection.assert_called()
      loaded_message.addSection.assert_has_calls(
          [call("Alert_Section")], any_order=False
      )
  
      # Verify buttons
      add_buttons_mock.assert_called()
      assert_equal(add_buttons_mock.call_count, 1)
  
imports: import pymsteams
  from pymsteams import TeamsWebhookException
  from mock import MagicMock, Mock, patch, call
  from nose.tools import assert_equal, assert_false, assert_true
  from streamalert.alert_processor.helpers import compose_alert
  from streamalert.alert_processor.outputs.teams import TeamsOutput
  from tests.unit.streamalert.alert_processor.helpers import get_alert, get_random_alert
label_desc: Use image node_id 15 for calling the TestTeamsOutput obj's underlying member method code with example usage: obj.test_format_message_buttons(_, alert_section_mock, add_buttons_mock) without return types