class_docstr: Tests for RulesEngine
class_docstr_tok: ["Tests","for","RulesEngine"]
docstr: RulesEngine - Rule Analysis, Staged
docstr_tok: ["RulesEngine","-","Rule","Analysis",",","Staged"]
code: def test_rule_analysis_staged(self):
      """RulesEngine - Rule Analysis, Staged"""
      rule = Mock(
          process=Mock(return_value=True),
          is_staged=Mock(return_value=True),
          outputs_set={"slack:test"},
          description="rule description",
          publishers=None,
          context=None,
          merge_by_keys=None,
          merge_window_mins=0,
      )
  
      # Override the Mock name attribute
      type(rule).name = PropertyMock(return_value="test_rule")
      record = {"foo": "bar"}
      payload = {
          "cluster": "prod",
          "log_schema_type": "log_type",
          "data_type": "json",
          "resource": "test_stream",
          "service": "kinesis",
          "record": record,
      }
  
      with patch.object(rules_engine_module, "Alert") as alert_mock:
          result = self._rules_engine._rule_analysis(payload, rule)
          alert_mock.assert_called_with(
              "test_rule",
              record,
              {"aws-firehose:alerts"},
              cluster="prod",
              context=None,
              log_source="log_type",
              log_type="json",
              merge_by_keys=None,
              merge_window=timedelta(minutes=0),
              publishers=None,
              rule_description="rule description",
              source_entity="test_stream",
              source_service="kinesis",
              staged=True,
          )
  
          assert_equal(result is not None, True)
  
imports: from datetime import datetime, timedelta
  from mock import Mock, patch, PropertyMock
  from nose.tools import assert_equal, assert_false, assert_true
  from publishers.community.generic import remove_internal_fields
  from streamalert.shared.publisher import AlertPublisher, Register, DefaultPublisher
  import streamalert.rules_engine.rules_engine
  from streamalert.rules_engine.rules_engine import RulesEngine
label_desc: Use image node_id 12 for calling the TestRulesEngine obj's underlying member method code with example usage: obj.test_rule_analysis_staged() without return types