Sha256: c666534a7b314642e14697581a7020ef144fbd8287c91eba35214450c3eb6087
Contents?: true
Size: 1010 Bytes
Versions: 14
Compression:
Stored size: 1010 Bytes
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for Get Virtual Machine Request class TestGetVirtualMachine < 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_get_virtual_machine_success response = ApiStub::Requests::Compute::VirtualMachine.create_virtual_machine_response(@compute_client) @virtual_machines.stub :get, response do assert_equal @service.get_virtual_machine('fog-test-rg', 'fog-test-server', false), response end end def test_get_virtual_machine_failure response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :get, response do assert_raises(MsRestAzure::AzureOperationError) { @service.get_virtual_machine('fog-test-rg', 'fog-test-server', false) } end end end
Version data entries
14 entries across 14 versions & 2 rubygems