class_docstr: Test class for SlackOutput
docstr: DemistoOutput - Dispatch Success, Response is Failure
docstr_tok: ["DemistoOutput","-","Dispatch","Success",",","Response","is","Failure"]
code: def test_dispatch_fail(self, request_mock, logger_spy):
      """DemistoOutput - Dispatch Success, Response is Failure"""
  
      mock_response = MagicMock()
      mock_response.status_code = 400  # bad request
      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_false(success)
  
      class Matcher:
          def __eq__(self, other):
              return isinstance(other, OutputRequestFailure)
  
      logger_spy.assert_called_with(
          "Failed to create Demisto incident: %s.", Matcher()
      )
  
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 4 for calling the TestDemistoOutput obj's underlying member method code with example usage: obj.test_dispatch_fail(request_mock, logger_spy) and returns: isinstance