class_docstr: Test class for PhantomOutput
class_docstr_tok: ["Test","class","for","PhantomOutput"]
docstr: PhantomOutput - Dispatch Failure, Artifact
docstr_tok: ["PhantomOutput","-","Dispatch","Failure",",","Artifact"]
code: def test_dispatch_failure(self, post_mock, get_mock, log_mock):
      """PhantomOutput - Dispatch Failure, Artifact"""
      # _check_container_exists
      get_mock.return_value.status_code = 200
      get_mock.return_value.json.return_value = {"count": 0, "data": []}
      # _setup_container, dispatch
      type(post_mock.return_value).status_code = PropertyMock(
          side_effect=[200, 400]
      )
      json_error = {"message": "error message", "errors": ["error1"]}
      post_mock.return_value.json.return_value.side_effect = [
          {"id": 1948},
          json_error,
      ]
  
      assert_false(self._dispatcher.dispatch(get_alert(), self.OUTPUT))
  
      log_mock.assert_called_with(
          "Failed to send alert to %s:%s", self.SERVICE, self.DESCRIPTOR
      )
  
file_path: streamalert/tests/unit/streamalert/alert_processor/outputs/test_phantom.py
imports: from mock import call, patch, PropertyMock, Mock, MagicMock
  from nose.tools import assert_false, assert_true
  from streamalert.alert_processor.outputs.phantom import PhantomOutput
  from tests.unit.streamalert.alert_processor.helpers import get_alert
label_desc: Use image node_id 8 for calling the TestPhantomOutput obj's underlying member method code with example usage: obj.test_dispatch_failure(post_mock, get_mock, log_mock) without return types