class_docstr: Tests for merger/main.py:AlertMerger class
class_docstr_tok: ["Tests","for","merger\/main.py",":","AlertMerger","class"]
docstr: Alert Merger - Alert Collection - Max Alerts Per Group
docstr_tok: ["Alert","Merger","-","Alert","Collection","-","Max","Alerts","Per","Group"]
code: def test_merge_groups_limit_reached(self):
      """Alert Merger - Alert Collection - Max Alerts Per Group"""
      alerts = [
          Alert(
              "same_rule_name",
              {"key": "A"},
              set(),
              created=datetime(year=2000, month=1, day=1),
              merge_by_keys=["key"],
              merge_window=timedelta(minutes=5),
          ),
      ] * 5
  
      # Since max alerts per group is 2, it should create 3 merged groups.
      groups = main.AlertMerger._merge_groups(alerts)
      assert_equal(3, len(groups))
      assert_equal(alerts[0:2], groups[0].alerts)
      assert_equal(alerts[2:4], groups[1].alerts)
      assert_equal(alerts[4:], groups[2].alerts)
  
imports: from datetime import datetime, timedelta
  import os
  from mock import ANY, call, patch, MagicMock
  from moto import mock_dynamodb2, mock_lambda
  from nose.tools import assert_equal, assert_false, assert_true
  from streamalert.alert_merger import main
  from streamalert.shared.alert import Alert
  from tests.unit.helpers.aws_mocks import create_lambda_function, setup_mock_alerts_table
label_desc: Use image node_id 7 for calling the TestAlertMerger obj's underlying member method code with example usage: obj.test_merge_groups_limit_reached() without return types