#NEWLINE# @ mock . patch . object ( irmc_boot , '_cleanup_vmedia_boot' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( irmc_boot , '_remove_share_file' , spec_set = True , autospec = True ) #NEWLINE# def test_clean_up_instance( self , _remove_share_file_mock , _cleanup_vmedia_boot_mock ) : #NEWLINE# #INDENT# with task_manager . acquire ( self . context , self . node . uuid , shared = False ) as task : #NEWLINE# #INDENT# task . node . instance_info [ 'irmc_boot_iso' ] = 'glance://deploy_iso' #NEWLINE# task . node . driver_internal_info [ 'irmc_boot_iso' ] = 'irmc_boot.iso' #NEWLINE# task . node . driver_internal_info = { #NEWLINE# #INDENT# 'root_uuid_or_disk_id' : '12312642-09d3-467f-8e09-12385826a123' , #NEWLINE# #UNINDENT# } #NEWLINE# task . driver . boot . clean_up_instance ( task ) #NEWLINE# _remove_share_file_mock . assert_called_once_with ( irmc_boot . _get_boot_iso_name ( task . node ) ) #NEWLINE# self . assertNotIn ( 'irmc_boot_iso' , self . node . driver_internal_info ) #NEWLINE# self . assertNotIn ( 'root_uuid_or_disk_id' , task . node . driver_internal_info ) #NEWLINE# _cleanup_vmedia_boot_mock . assert_called_once_with ( task )