Sha256: 76944a8c71817dbf66be7aa7c533c6dced1a31225692845db195f23dfb1cc3d2

Contents?: true

Size: 1.3 KB

Versions: 39

Compression:

Stored size: 1.3 KB

Contents

Shindo.tests('Compute::VcloudDirector | vdc requests', ['vclouddirector']) do

  @service = Fog::Compute::VcloudDirector.new
  @org = VcloudDirector::Compute::Helper.current_org(@service)

  tests('#get_vdc').data_matches_schema(VcloudDirector::Compute::Schema::VDC_TYPE) do
    link = @org[:Link].detect do |l|
      l[:rel] == 'down' && l[:type] == 'application/vnd.vmware.vcloud.vdc+xml'
    end
    @vdc_id = link[:href].split('/').last
    @service.get_vdc(@vdc_id).body
  end

  tests('#get_vdc_metadata').data_matches_schema(VcloudDirector::Compute::Schema::METADATA_TYPE) do
    pending if Fog.mocking?
    @service.get_vdc_metadata(@vdc_id).body
  end

  tests('#get_vdcs_from_query') do
    pending if Fog.mocking?
    %w[idrecords records references].each do |format|
      tests(":format => #{format}") do
        tests('#body').data_matches_schema(VcloudDirector::Compute::Schema::CONTAINER_TYPE) do
          @body = @service.get_vdcs_from_query(:format => format).body
        end
        key = (format == 'references') ? 'OrgVdcReference' : 'OrgVdcRecord'
        tests("#body.key?(:#{key})").returns(true) { @body.key?(key.to_sym) }
      end
    end
  end

  tests('Retrieve non-existent vDC').raises(Fog::Compute::VcloudDirector::Forbidden) do
    @service.get_vdc('00000000-0000-0000-0000-000000000000')
  end

end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
fog-1.22.0 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-1.21.0 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-1.20.0 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-1.19.0 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/vcloud_director/requests/compute/vdc_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/vcloud_director/requests/compute/vdc_tests.rb