Sha256: 1c3c5480a80b8bc413cf4e5396757c1a7059d3f8bab30ec1672b12426c9ae3ef

Contents?: true

Size: 1.14 KB

Versions: 18

Compression:

Stored size: 1.14 KB

Contents

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

# Test class for Get Backup Job for VM request
class TestGetBackupJobForVM < Minitest::Test
  def setup
    @service = Fog::Storage::AzureRM.new(credentials)
    @token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
  end

  def test_get_backup_job_for_vm_success
    backup_jobs_response = ApiStub::Requests::Storage::RecoveryVault.get_all_backup_jobs_response
    single_backup_job_response = JSON.parse(backup_jobs_response)['value'][0]
    @service.stub :get_all_backup_jobs, JSON.parse(backup_jobs_response)['value'] do
      assert_equal @service.get_backup_job_for_vm('fog-test-vault', 'fog-test-vault', 'fog-test-vm', 'fog-test-vm-rg', 'Backup'), single_backup_job_response
    end
  end

  def test_get_backup_job_for_vm_argument_error
    backup_jobs_response = ApiStub::Requests::Storage::RecoveryVault.get_all_backup_jobs_response
    @service.stub :get_all_backup_jobs, JSON.parse(backup_jobs_response)['value'] do
      assert_raises ArgumentError do
        @service.get_backup_job_for_vm('fog-test-vault', 'fog-test-vault', 'fog-test-vm')
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
fog-azure-rm-temp-0.0.4 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.3.3 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-temp-0.0.2 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-temp-0.0.1 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.3.2 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-downgraded-0.3.1 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.3.1 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-downgraded-0.3.0 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.3.0 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.7 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.6 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.5 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.4 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.3 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.2 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.1 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.2.0 test/requests/storage/test_get_backup_job_for_vm.rb
fog-azure-rm-0.1.2 test/requests/storage/test_get_backup_job_for_vm.rb