#NEWLINE# @ mock . patch . object ( images , 'create_boot_iso' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( deploy_utils , 'get_boot_mode_for_deploy' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( images , 'get_image_properties' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( images , 'fetch' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( irmc_boot , '_parse_deploy_info' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( service_utils , 'is_image_href_ordinary_file_name' , spec_set = True , autospec = True ) #NEWLINE# def test__prepare_boot_iso_fetch_ok( self , is_image_href_ordinary_file_name_mock , deploy_info_mock , fetch_mock , image_props_mock , boot_mode_mock , create_boot_iso_mock ) : #NEWLINE# #INDENT# CONF . irmc . remote_image_share_root = '/' #NEWLINE# image = '733d1c44-a2ea-414b-aca7-69decf20d810' #NEWLINE# is_image_href_ordinary_file_name_mock . return_value = False #NEWLINE# deploy_info_mock . return_value = { #NEWLINE# #INDENT# 'irmc_boot_iso' : image , #NEWLINE# #UNINDENT# } #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid , shared = False ) as task : #NEWLINE# #INDENT# task . node . instance_info [ 'irmc_boot_iso' ] = image #NEWLINE# irmc_boot . _prepare_boot_iso ( task , 'root-uuid' ) #NEWLINE# deploy_info_mock . assert_called_once_with ( task . node ) #NEWLINE# fetch_mock . assert_called_once_with ( task . context , image , ( '/boot-%s.iso' % self . node . uuid ) ) #NEWLINE# self . assertFalse ( image_props_mock . called ) #NEWLINE# self . assertFalse ( boot_mode_mock . called ) #NEWLINE# self . assertFalse ( create_boot_iso_mock . called ) #NEWLINE# task . node . refresh ( ) #NEWLINE# self . assertEqual ( ( 'boot-%s.iso' % self . node . uuid ) , task . node . driver_internal_info [ 'irmc_boot_iso' ] )