'Checks that the client context received all server messages.'

def CheckClientQueue(self):

    self.assertEqual(self.client_communicator.client_worker.InQueueSize(), 10)
    for (i, message) in enumerate(self.client_communicator.client_worker._in_queue.queue):
        self.assertEqual(message.source, 'aff4:/GRR    Test    Server')
        self.assertEqual(message.response_id, 2)
        self.assertEqual(message.request_id, i)
        self.assertEqual(message.session_id, 'aff4:/W:session')
        self.assertEqual(message.auth_state, rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED)
    self.client_communicator.client_worker._in_queue.queue.clear()
