Sha256: 951fa8a1fc4a9c9ff16a706c805f93e0f91be2ceb272a3e25a4620a2cd73c13c

Contents?: true

Size: 1.34 KB

Versions: 39

Compression:

Stored size: 1.34 KB

Contents

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

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

  tests('Get first vDC') do
    session = @service.get_current_session.body
    link = @org[:Link].detect do |l|
      l[:type] == 'application/vnd.vmware.vcloud.vdc+xml'
    end
    @vdc = @service.get_vdc(link[:href].split('/').last).body
  end

  # 'Envelope' is the outer type of the parsed XML document.
  tests('#get_vapp_ovf_descriptor').returns('Envelope') do
    pending if Fog.mocking?
    link = @vdc[:ResourceEntities][:ResourceEntity].detect do |l|
      l[:type] == 'application/vnd.vmware.vcloud.vApp+xml'
    end
    pending if link.nil?
    body = @service.get_vapp_ovf_descriptor(link[:href].split('/').last).body
    Nokogiri::XML::Document.parse(body).children.first.name
  end

  # 'Envelope' is the outer type of the parsed XML document.
  tests('#get_vapp_template_ovf_descriptor').returns('Envelope') do
    pending if Fog.mocking?
    link = @vdc[:ResourceEntities][:ResourceEntity].detect do |l|
      l[:type] == 'application/vnd.vmware.vcloud.vAppTemplate+xml'
    end
    pending if link.nil?
    body = @service.get_vapp_template_ovf_descriptor(link[:href].split('/').last).body
    Nokogiri::XML::Document.parse(body).children.first.name
  end

end

Version data entries

39 entries across 39 versions & 2 rubygems

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