#NEWLINE# @ mock . patch . object ( manager_utils , 'node_set_boot_device' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( irmc_boot , '_setup_vmedia_for_boot' , spec_set = True , autospec = True ) #NEWLINE# def test_attach_boot_iso_if_needed( self , setup_vmedia_mock , set_boot_device_mock ) : #NEWLINE# #INDENT# with task_manager . acquire ( self . context , self . node . uuid , shared = True ) as task : #NEWLINE# #INDENT# task . node . provision_state = states . ACTIVE #NEWLINE# task . node . driver_internal_info [ 'irmc_boot_iso' ] = 'boot-iso' #NEWLINE# irmc_boot . attach_boot_iso_if_needed ( task ) #NEWLINE# setup_vmedia_mock . assert_called_once_with ( setup_vmedia_mock , 'boot-iso' ) #NEWLINE# set_boot_device_mock . assert_called_once_with ( task , boot_devices . CDROM )