'This tests the Hunt notification event.'

def testHuntNotifications(self):

    TestHuntListener.received_events = []
    client_ids = self.SetupClients(10)
    client_rule_set = rdf_foreman.ForemanClientRuleSet(rules=[rdf_foreman.ForemanClientRule(rule_type=rdf_foreman.ForemanClientRule.Type.REGEX, regex=rdf_foreman.ForemanRegexClientRule(attribute_name='GRR    client', attribute_regex='GRR'))])
    with implementation.GRRHunt.StartHunt(hunt_name=BrokenSampleHunt.__name__, client_rule_set=client_rule_set, client_rate=0, notification_event='TestHuntDone', token=self.token) as hunt:
        hunt.GetRunner().Start()
    foreman = aff4.FACTORY.Open('aff4:/foreman', mode='rw', token=self.token)
    for client_id in client_ids:
        foreman.AssignTasksToClient(client_id)
    client_mock = hunt_test_lib.SampleHuntMock()
    hunt_test_lib.TestHuntHelper(client_mock, client_ids, check_flow_errors=False, token=self.token)
    self.assertEqual(len(TestHuntListener.received_events), 5)
