Sha256: fbb4699d076fb2bcf83c73aa07f35eee9e386b6d466d5ae471cc00420925876d

Contents?: true

Size: 735 Bytes

Versions: 8

Compression:

Stored size: 735 Bytes

Contents

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

# Test class for Get Image Request
class TestGetImage < Minitest::Test
  def setup
    @service = Fog::Compute::AzureRM.new(credentials)
    compute_client = @service.instance_variable_get(:@compute_mgmt_client)
    @image = compute_client.images
  end

  def test_get_image_success
    @image.stub :get, true do
      assert @service.get_image('fog-test-rg', 'TestImage')
    end
  end

  def test_get_image_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @image.stub :get, response do
      assert_raises(RuntimeError) { @service.get_image('fog-test-rg', 'TestImage') }
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
fog-azure-rm-0.4.5 test/requests/compute/test_get_image.rb
fog-azure-rm-temp-0.0.5 test/requests/compute/test_get_image.rb
fog-azure-rm-0.4.4 test/requests/compute/test_get_image.rb
fog-azure-rm-0.4.3 test/requests/compute/test_get_image.rb
far-gem-0.5.1 test/requests/compute/test_get_image.rb
fog-azure-rm-0.4.2 test/requests/compute/test_get_image.rb
fog-azure-rm-0.4.1 test/requests/compute/test_get_image.rb
fog-azure-rm-0.4.0 test/requests/compute/test_get_image.rb