Sha256: c29e44361d0331184c72e086cf185c1e2bf5fccb094d6260a809531bf2974c2b

Contents?: true

Size: 1.64 KB

Versions: 30

Compression:

Stored size: 1.64 KB

Contents

# frozen_string_literal: true

# Copyright 2018 Tristan Robert

# This file is part of ForemanFogProxmox.

# ForemanFogProxmox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# ForemanFogProxmox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>.

require 'test_plugin_helper'
require 'models/compute_resources/compute_resource_test_helpers'
require 'factories/foreman_fog_proxmox/proxmox_node_mock_factory'
require 'factories/foreman_fog_proxmox/proxmox_server_mock_factory'
require 'factories/foreman_fog_proxmox/proxmox_container_mock_factory'
require 'active_support/core_ext/hash/indifferent_access'

module ForemanFogProxmox
  class ProxmoxVmCommandsServerTest < ActiveSupport::TestCase
    include ComputeResourceTestHelpers
    include ProxmoxNodeMockFactory
    include ProxmoxServerMockFactory
    include ProxmoxContainerMockFactory
    include ProxmoxVmHelper

    describe 'destroy_vm' do
      it 'handles situation when vm is not present' do
        cr = mock_cr_servers(ForemanFogProxmox::Proxmox.new, empty_servers)
        cr.expects(:find_vm_by_uuid).raises(ActiveRecord::RecordNotFound)
        assert cr.destroy_vm('abc')
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
foreman_fog_proxmox-0.11.0 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.10.2 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.10.1 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.10.0 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.9.4 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.9.3 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.9.2 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.9.1 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.9.0 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb
foreman_fog_proxmox-0.8.2 test/unit/foreman_fog_proxmox/proxmox_vm_commands_test.rb