'Test priority and fast poll settings propagated to status results.'

def testPriorityAndFastPoll(self):

    for i in range(10):
        message = rdf_flows.GrrMessage(name='MockAction', session_id=(self.session_id.Basename() + str(i)), auth_state=rdf_flows.GrrMessage.AuthorizationState.UNAUTHENTICATED, request_id=1, priority=(i % 3), require_fastpoll=(i % 2), generate_task_id=True)
        self.context.HandleMessage(message)
    message_list = self.context.Drain(max_size=1000000).job
    self.assertEqual(len(message_list), 10)
    self.assertEqual([m.priority for m in message_list], [2, 2, 2, 1, 1, 1, 0, 0, 0, 0])
    self.assertEqual([m.require_fastpoll for m in message_list], [0, 1, 0, 1, 0, 1, 0, 1, 0, 1])
