'Check that flows log correctly.'

def testFlowLogging(self):

    flow_urn = None
    for session_id in flow_test_lib.TestFlowHelper(flow_test_lib.DummyLogFlow.__name__, action_mocks.ActionMock(), token=self.token, client_id=self.client_id):
        flow_urn = session_id
    log_collection = flow.GRRFlow.LogCollectionForFID(flow_urn, token=self.token)
    self.assertEqual(len(log_collection), 8)
    for log in log_collection:
        self.assertEqual(log.client_id, self.client_id)
        self.assertTrue((log.log_message in ['First', 'Second', 'Third', 'Fourth', 'Uno', 'Dos', 'Tres', 'Cuatro']))
        self.assertTrue((log.flow_name in [flow_test_lib.DummyLogFlow.__name__, flow_test_lib.DummyLogFlowChild.__name__]))
        self.assertTrue((str(flow_urn) in str(log.urn)))
