#NEWLINE# def test_reserved_timed_out( self ) : #NEWLINE# #INDENT# 'If a user has a position in the queue, and the time assigned finishes, then this user is removed' #NEWLINE# now = time_mod . time ( ) #NEWLINE# self . coordinator . time_provider . _TEST_TIME = now #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_status1 = WSS . WaitingConfirmationQueueStatus ( reservation1_id , DEFAULT_URL ) #NEWLINE# self . assertEquals ( expected_status1 , status ) #NEWLINE# ( status , reservation2_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , ( DEFAULT_TIME * 2 ) , DEFAULT_PRIORITY , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status2 = WSS . WaitingConfirmationQueueStatus ( reservation2_id , DEFAULT_URL ) #NEWLINE# self . assertEquals ( expected_status2 , status ) #NEWLINE# ( status , reservation3_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'exp1' , 'cat1' ) , DEFAULT_TIME , DEFAULT_PRIORITY , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status3 = WSS . WaitingQueueStatus ( reservation3_id , 0 ) #NEWLINE# self . assertEquals ( expected_status3 , status ) #NEWLINE# status = self . coordinator . get_reservation_status ( reservation1_id ) #NEWLINE# self . assertEquals ( expected_status1 , status ) #NEWLINE# status = self . coordinator . get_reservation_status ( reservation2_id ) #NEWLINE# self . assertEquals ( expected_status2 , status ) #NEWLINE# status = self . coordinator . get_reservation_status ( reservation3_id ) #NEWLINE# self . assertEquals ( expected_status3 , status ) #NEWLINE# self . coordinator . time_provider . _TEST_TIME = ( now + ( DEFAULT_TIME * 1.5 ) ) #NEWLINE# self . assertRaises ( CoordExc . ExpiredSessionError , self . coordinator . get_reservation_status , reservation1_id ) #NEWLINE# status = self . coordinator . get_reservation_status ( reservation2_id ) #NEWLINE# self . assertEquals ( expected_status2 , status ) #NEWLINE# status = self . coordinator . get_reservation_status ( reservation3_id ) #NEWLINE# self . assertEquals ( reservation1_id , status )