#NEWLINE# @ mock . patch ( 'hyperv.nova.volumeops.VolumeOps.disconnect_volumes' ) #NEWLINE# @ mock . patch ( 'hyperv.nova.vmops.VMOps._delete_disk_files' ) #NEWLINE# @ mock . patch ( 'hyperv.nova.vmops.VMOps.power_off' ) #NEWLINE# @ mock . patch ( 'hyperv.nova.vmops.VMOps.unplug_vifs' ) #NEWLINE# def test_destroy( self , mock_unplug_vifs , mock_power_off , mock_delete_disk_files , mock_disconnect_volumes ) : #NEWLINE# #INDENT# mock_instance = fake_instance . fake_instance_obj ( self . context ) #NEWLINE# self . _vmops . _vmutils . vm_exists . return_value = True #NEWLINE# self . _vmops . destroy ( instance = mock_instance , block_device_info = mock . sentinel . FAKE_BD_INFO , network_info = mock . sentinel . fake_network_info ) #NEWLINE# self . _vmops . _vmutils . vm_exists . assert_called_with ( mock_instance . name ) #NEWLINE# mock_power_off . assert_called_once_with ( mock_instance ) #NEWLINE# self . _vmops . _vmutils . destroy_vm . assert_called_once_with ( mock_instance . name ) #NEWLINE# mock_disconnect_volumes . assert_called_once_with ( mock . sentinel . FAKE_BD_INFO ) #NEWLINE# mock_delete_disk_files . assert_called_once_with ( mock_instance . name ) #NEWLINE# mock_unplug_vifs . assert_called_once_with ( mock_instance , mock . sentinel . fake_network_info )