class_docstr: Test class for SlackOutput
class_docstr_tok: ["Test","class","for","SlackOutput"]
docstr: SlackOutput - Format Message, Custom Attachment is Truncated
docstr_tok: ["SlackOutput","-","Format","Message",",","Custom","Attachment","is","Truncated"]
code: def test_format_message_custom_attachment_limit(self, log_warning):
      """SlackOutput - Format Message, Custom Attachment is Truncated"""
      rule_name = "test_empty_rule_description"
      alert = get_random_alert(10, rule_name, True)
      output = MagicMock(spec=SlackOutput)
      alert_publication = compose_alert(alert, output, "asdf")
  
      long_message = "a" * (SlackOutput.MAX_MESSAGE_SIZE + 1)
      alert_publication["@slack.attachments"] = [{"text": long_message}]
  
      loaded_message = SlackOutput._format_message(
          alert, alert_publication
      )
  
      # tests
      assert_equal(
          len(loaded_message["attachments"][0]["text"]), 3999
      )  # bug in elide
      log_warning.assert_called_with(
          "Custom attachment was truncated to length %d. Full message: %s",
          SlackOutput.MAX_MESSAGE_SIZE,
          long_message,
      )
  
imports: from collections import Counter, OrderedDict
  from mock import patch, Mock, MagicMock
  from nose.tools import assert_equal, assert_false, assert_true, assert_set_equal
  from streamalert.alert_processor.helpers import compose_alert
  from streamalert.alert_processor.outputs.slack import SlackOutput
  from tests.unit.streamalert.alert_processor.helpers import get_random_alert, get_alert
label_desc: Use image node_id 5 for calling the TestSlackOutput obj's underlying member method code with example usage: obj.test_format_message_custom_attachment_limit(log_warning) without return types