#NEWLINE# def test_reserve_resource_does_not_support_expected_experiment_and_there_are_waiting( self ) : #NEWLINE# #INDENT# self . cfg_manager . _set_value ( COORDINATOR_LABORATORY_SERVERS , { #NEWLINE# #INDENT# 'lab1:inst@machine' : { #NEWLINE# #INDENT# 'exp1|ud-binary|Binary experiments' : 'pld1@pld boards' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'lab2:inst@machine' : { #NEWLINE# #INDENT# 'exp2|ud-pld|PLD experiments' : 'pld2@pld boards' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . coordinator = self . WrappedCoordinator ( self . locator_mock , self . cfg_manager , ConfirmerClass = ConfirmerMock ) #NEWLINE# self . coordinator . _clean ( ) #NEWLINE# self . coordinator . add_experiment_instance_id ( 'lab1:inst@machine' , ExperimentInstanceId ( 'exp1' , 'ud-binary' , 'Binary experiments' ) , Resource ( 'pld boards' , 'pld1' ) ) #NEWLINE# self . coordinator . add_experiment_instance_id ( 'lab2:inst@machine' , ExperimentInstanceId ( 'exp2' , 'ud-pld' , 'PLD experiments' ) , Resource ( 'pld boards' , 'pld2' ) ) #NEWLINE# ( status , reservation1_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'ud-pld' , 'PLD experiments' ) , ( DEFAULT_TIME + 1 ) , 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 ( 'ud-pld' , 'PLD experiments' ) , ( DEFAULT_TIME + 2 ) , DEFAULT_PRIORITY , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingQueueStatus ( reservation2_id , 0 ) #NEWLINE# self . assertEquals ( expected_status , status ) #NEWLINE# ( status , reservation3_id ) = self . coordinator . reserve_experiment ( ExperimentId ( 'ud-binary' , 'Binary experiments' ) , ( DEFAULT_TIME + 3 ) , DEFAULT_PRIORITY , True , DEFAULT_INITIAL_DATA , DEFAULT_REQUEST_INFO , DEFAULT_CONSUMER_DATA ) #NEWLINE# expected_status = WSS . WaitingConfirmationQueueStatus ( expected_status , DEFAULT_URL ) #NEWLINE# self . assertEquals ( expected_status , status )