class_docstr: Test class for SlackOutput
docstr: DemistoOutput - Dispatch Success, Mocked Request Session
docstr_tok: ["DemistoOutput","-","Dispatch","Success",",","Mocked","Request","Session"]
code: def test_dispatch(self, request_mock):
      """DemistoOutput - Dispatch Success, Mocked Request Session"""
      mock_response = MagicMock()
      mock_response.status_code = 201
      request_mock.return_value = mock_response
  
      alert = get_alert(context=SAMPLE_CONTEXT)
      alert.created = datetime(2019, 1, 1)
  
      success = self._dispatcher.dispatch(alert, self.OUTPUT)
  
      assert_true(success)
  
      expected_data = {
          "type": "Unclassified",
          "name": "cb_binarystore_file_added",
          "owner": "StreamAlert",
          "playbook": "Unknown",
          "severity": 0,
          "labels": EXPECTED_LABELS_FOR_SAMPLE_ALERT,
          "customFields": {},
          "details": "Info about this rule and what actions to take",
          "createInvestigation": True,
      }
  
      class Matcher:
          def __eq__(self, other):
              if other == expected_data:
                  return True
  
              # If you have trouble debugging the differences of the large JSON dicts like I did,
              # pretty print the result!
              #
              # import pprint
              # pp = pprint.PrettyPrinter(indent=4)
              # pp.pprint(other)
              return False
  
      request_mock.assert_called_with(
          "https://demisto.awesome-website.io/incident",
          headers={
              "Accept": "application/json",
              "Content-type": "application/json",
              "Authorization": "aaaabbbbccccddddeeeeffff",
          },
          json=Matcher(),
          verify=False,
          timeout=3.05,
      )
  
file_path: streamalert/tests/unit/streamalert/alert_processor/outputs/test_demisto.py
imports: from collections import OrderedDict
  from datetime import datetime
  from mock import patch, Mock, MagicMock
  from nose.tools import assert_is_instance, assert_true, assert_false, assert_equal
  from streamalert.alert_processor.helpers import compose_alert
  from streamalert.alert_processor.outputs.demisto import DemistoOutput, DemistoRequestAssembler
  from streamalert.alert_processor.outputs.output_base import OutputRequestFailure
  from tests.unit.streamalert.alert_processor.helpers import get_alert
label_desc: Use image node_id 3 for calling the TestDemistoOutput obj's underlying member method code with example usage: obj.test_dispatch(request_mock) and returns: False, True