class_docstr: Tests for shared/alert_table.py
docstr: Alert Table - Mark As Dispatched - Alert is Already Deleted
docstr_tok: ["Alert","Table","-","Mark","As","Dispatched","-","Alert","is","Already","Deleted"]
code: def test_mark_as_dispatched_conditional_fail(self):
      """Alert Table - Mark As Dispatched - Alert is Already Deleted"""
      self.alert_table._table = MagicMock()
  
      def mock_update(**kwargs):  # pylint: disable=unused-argument
          raise ClientError(
              {"Error": {"Code": "ConditionalCheckFailedException"}},
              "UpdateItem",
          )
  
      self.alert_table._table.update_item.side_effect = mock_update
  
      # No error should be raised if the conditional delete failed
      alert = self.alerts[1]
      alert.attempts = 1
      alert.dispatched = datetime.utcnow()
      self.alert_table.mark_as_dispatched(alert)
      self.alert_table._table.update_item.assert_called_once_with(
          Key={"RuleName": alert.rule_name, "AlertID": alert.alert_id},
          UpdateExpression="SET Attempts = :attempts, Dispatched = :dispatched",
          ExpressionAttributeValues={
              ":attempts": 1,
              ":dispatched": ANY,
          },
          ConditionExpression="attribute_exists(AlertID)",
      )
  
imports: from datetime import datetime
  import os
  from botocore.exceptions import ClientError
  from mock import ANY, MagicMock, patch
  from moto import mock_dynamodb2
  from nose.tools import assert_equal, assert_raises
  from streamalert.shared import alert, alert_table
  from tests.unit.helpers.aws_mocks import setup_mock_alerts_table
label_desc: Use image node_id 10 for calling the TestAlertTable obj's underlying member method code with example usage: obj.test_mark_as_dispatched_conditional_fail() without return types