#NEWLINE# def test_remove_resource_instance( self ) : #NEWLINE# #INDENT# session = self . session_maker ( ) #NEWLINE# try : #NEWLINE# #INDENT# exp_id = ExperimentInstanceId ( 'exp1' , 'ud-pld' , 'PLD Experiments' ) #NEWLINE# resource_instance = Resource ( 'type' , 'instance' ) #NEWLINE# self . resources_manager . add_experiment_instance_id ( 'laboratory1:WL_SERVER1@WL_MACHINE1' , exp_id , resource_instance ) #NEWLINE# experiment_instances = session . query ( CoordinatorModel . ExperimentInstance ) . all ( ) #NEWLINE# self . assertEquals ( 1 , len ( experiment_instances ) ) #NEWLINE# resource_instances = session . query ( CoordinatorModel . ResourceInstance ) . all ( ) #NEWLINE# self . assertEquals ( 1 , len ( resource_instances ) ) #NEWLINE# self . resources_manager . remove_resource_instance ( session , resource_instance ) #NEWLINE# resource_instances = session . query ( CoordinatorModel . ResourceInstance ) . all ( ) #NEWLINE# self . assertEquals ( 0 , len ( resource_instances ) ) #NEWLINE# experiment_instances = session . query ( CoordinatorModel . ExperimentInstance ) . all ( ) #NEWLINE# self . assertEquals ( 0 , len ( experiment_instances ) ) #NEWLINE# session . commit ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# session . close ( )