'Helper to handle running the collector flow.'

def RunCollectorAndGetCollection(self, artifact_list, client_mock=None, **kw):

    if (client_mock is None):
        client_mock = self.MockClient(client_id=self.client_id)
    for s in flow_test_lib.TestFlowHelper(collectors.ArtifactCollectorFlow.__name__, client_mock=client_mock, client_id=self.client_id, artifact_list=artifact_list, token=self.token, **kw):
        session_id = s
    return flow.GRRFlow.ResultCollectionForFID(session_id, token=self.token)
