Sha256: e14b68239fd3ca486306416544e0afb8a446c2c63ac91576f0904e831244765e

Contents?: true

Size: 1.13 KB

Versions: 13

Compression:

Stored size: 1.13 KB

Contents

require File.expand_path '../../test_helper', __dir__

# Test class for List Available Sizes For VirtualMachine Request
class TestListAvailableSizesForVirtualMachine < Minitest::Test
  def setup
    @service = Fog::Compute::AzureRM.new(credentials)
    @compute_client = @service.instance_variable_get(:@compute_mgmt_client)
    @virtual_machines = @compute_client.virtual_machines
  end

  def test_list_available_sizes_for_virtual_machine_success
    response = ApiStub::Requests::Compute::VirtualMachine.list_available_sizes_for_virtual_machine_response(@compute_client)
    @virtual_machines.stub :list_available_sizes, response do
      assert_equal @service.list_available_sizes_for_virtual_machine('fog-test-rg', 'fog-test-server'), response.value
    end
  end

  def test_list_available_sizes_for_virtual_machine_failure
    response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @virtual_machines.stub :list_available_sizes, response do
      assert_raises(RuntimeError) { @service.list_available_sizes_for_virtual_machine('fog-test-rg', 'fog-test-server') }
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
fog-azure-rm-downgraded-0.3.1 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.3.1 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-downgraded-0.3.0 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.3.0 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.7 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.6 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.5 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.4 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.3 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.2 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.1 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.2.0 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb
fog-azure-rm-0.1.2 test/requests/compute/test_list_available_sizes_for_virtual_machine.rb