#NEWLINE# @ mock . patch . object ( vm_utils , 'destroy_vm' ) #NEWLINE# @ mock . patch . object ( vm_utils , 'clean_shutdown_vm' , return_value = False ) #NEWLINE# @ mock . patch . object ( vm_utils , 'hard_shutdown_vm' ) #NEWLINE# def test_clean_shutdown_with_bdm_failed_on_destroy( self , hard_shutdown_vm , clean_shutdown_vm , destroy_vm ) : #NEWLINE# #INDENT# vm_ref = 'vm_ref' #NEWLINE# block_device_info = { #NEWLINE# #INDENT# 'block_device_mapping' : [ 'fake' ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . _vmops . _destroy ( self . instance , vm_ref , destroy_disks = False , block_device_info = block_device_info ) #NEWLINE# clean_shutdown_vm . assert_called_once_with ( self . _vmops . _session , self . instance , destroy_vm ) #NEWLINE# hard_shutdown_vm . assert_called_once_with ( self . _vmops . _session , self . instance , vm_ref )