#NEWLINE# def test_reserve_experiment_with_priority( self ) : #NEWLINE# #INDENT# 'Reserve an experiment with different priorities to check that a more priority user moves faster in the queue ' #NEWLINE# ( status , reservation1_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , DEFAULT_TIME , DEFAULT_PRIORITY , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingConfirmationQueueStatus ( reservation1_id , DEFAULT_URL ) #NEWLINE# self . assertEquals ( expected_status , status ) #NEWLINE# ( status , reservation2_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , DEFAULT_TIME , DEFAULT_PRIORITY , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingConfirmationQueueStatus ( reservation2_id , DEFAULT_URL ) #NEWLINE# self . assertEquals ( expected_status , status ) #NEWLINE# ( status , reservation3_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , DEFAULT_TIME , 4 , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingQueueStatus ( reservation3_id , 0 ) #NEWLINE# self . assertEquals ( expected_status , status ) #NEWLINE# ( status , reservation4_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , DEFAULT_TIME , 3 , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingQueueStatus ( reservation4_id , 0 ) #NEWLINE# self . assertEquals ( expected_status , status ) #NEWLINE# status = self . coordinator . get_reservation_status ( reservation3_id ) #NEWLINE# expected_status = WSS . WaitingQueueStatus ( reservation3_id , 1 ) #NEWLINE# self . assertEquals ( expected_status , status ) #NEWLINE# ( status , reservation5_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , DEFAULT_TIME , 3 , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingQueueStatus ( reservation5_id , 1 ) #NEWLINE# self . assertEquals ( expected_status , status )