#NEWLINE# @ mock . patch ( 'ironic_python_agent.extensions.standby._write_configdrive_to_partition' , autospec = True ) #NEWLINE# @ mock . patch ( 'ironic_python_agent.hardware.dispatch_to_managers' , autospec = True ) #NEWLINE# @ mock . patch ( 'ironic_python_agent.extensions.standby.StandbyExtension._cache_and_write_image' , autospec = True ) #NEWLINE# @ mock . patch ( 'ironic_python_agent.extensions.standby.StandbyExtension._stream_raw_image_onto_device' , autospec = True ) #NEWLINE# def _test_prepare_image_raw( self , image_info , stream_mock , cache_write_mock , dispatch_mock , configdrive_copy_mock ) : #NEWLINE# #INDENT# dispatch_mock . return_value = '/dev/foo' #NEWLINE# configdrive_copy_mock . return_value = None #NEWLINE# async_result = self . agent_extension . prepare_image ( image_info = image_info , configdrive = None ) #NEWLINE# async_result . join ( ) #NEWLINE# dispatch_mock . assert_called_once_with ( 'get_os_install_device' ) #NEWLINE# self . assertFalse ( configdrive_copy_mock . called ) #NEWLINE# if image_info [ 'stream_raw_images' ] : #NEWLINE# #INDENT# stream_mock . assert_called_once_with ( mock . ANY , image_info , '/dev/foo' ) #NEWLINE# self . assertFalse ( cache_write_mock . called ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cache_write_mock . assert_called_once_with ( mock . ANY , image_info , '/dev/foo' ) #NEWLINE# self . assertFalse ( stream_mock . called )