Sha256: 35188f328e441b3fa05e0b3af80343f8cadd7d4c94507ba7cd4727e9ecad9a03
Contents?: true
Size: 916 Bytes
Versions: 6
Compression:
Stored size: 916 Bytes
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for PowerOff Virtual Machine Request class TestPowerOffVirtualMachine < 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_power_off_virtual_machine_success @virtual_machines.stub :power_off, true do assert @service.power_off_virtual_machine('fog-test-rg', 'fog-test-server') end end def test_power_off_virtual_machine_failure response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :power_off, response do assert_raises(RuntimeError) { @service.power_off_virtual_machine('fog-test-rg', 'fog-test-server') } end end end
Version data entries
6 entries across 6 versions & 1 rubygems