def mock_ruletype(conf, es):
    rule = AnyRule(conf, es=es)
    rule.add_data = mock.Mock()
    rule.add_count_data = mock.Mock()
    rule.garbage_collect = mock.Mock()
    rule.add_terms_data = mock.Mock()
    rule.find_pending_aggregate_alert = mock.Mock()
    rule.find_pending_aggregate_alert.return_value = False
    rule.is_silenced = mock.Mock()
    rule.is_silenced.return_value = False
    rule.matches = []
    rule.get_match_data = (lambda x: x)
    rule.get_match_str = (lambda x: 'some stuff happened')
    rule.garbage_collect = mock.Mock()
    return rule
def mock_ruletype(conf, es):
    rule = AnyRule(conf, es=es)
    rule.add_data = mock.Mock()
    rule.add_count_data = mock.Mock()
    rule.garbage_collect = mock.Mock()
    rule.add_terms_data = mock.Mock()
    rule.find_pending_aggregate_alert = mock.Mock()
    rule.find_pending_aggregate_alert.return_value = False
    rule.is_silenced = mock.Mock()
    rule.is_silenced.return_value = False
    rule.matches = []
    rule.get_match_data = (lambda x: x)
    rule.get_match_str = (lambda x: 'some stuff happened')
    rule.garbage_collect = mock.Mock()
    return rule