#NEWLINE# @ mock . patch . object ( vm_utils , '_clone_vdi' , return_value = 'new_vdi_ref' ) #NEWLINE# @ mock . patch . object ( vm_utils , '_fetch_image' , return_value = { #NEWLINE# #INDENT# 'root' : { #NEWLINE# #INDENT# 'uuid' : 'vdi_uuid' , #NEWLINE# 'file' : None , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_noncached( self , mock_fetch_image , mock_clone_vdi , mock_safe_find_sr ) : #NEWLINE# #INDENT# self . session . call_xenapi . side_effect = [ 'ext' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , 'cache_vdi_ref' , None , None , None , None , None , None , 'vdi_uuid' ] #NEWLINE# self . assertEqual ( ( True , { #NEWLINE# #INDENT# 'root' : { #NEWLINE# #INDENT# 'uuid' : 'vdi_uuid' , #NEWLINE# 'file' : None , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) , vm_utils . _create_cached_image ( 'context' , self . session , 'instance' , 'name' , 'uuid' , vm_utils . ImageType . DISK_VHD ) )