Sha256: a680655ab802f4a0d2d98841c6cc1461778c449a16a786ef2eb09959e70ee24c

Contents?: true

Size: 1.43 KB

Versions: 57

Compression:

Stored size: 1.43 KB

Contents

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

  @service = Fog::Compute::VcloudDirector.new

  tests('#get_organizations').data_matches_schema(VcloudDirector::Compute::Schema::ORG_LIST_TYPE) do
    @org_list = @service.get_organizations.body
  end

  tests('#get_organization').data_matches_schema(VcloudDirector::Compute::Schema::ORG_TYPE) do
    org = @org_list[:Org].find {|o| o[:name] == @service.org_name}
    @org_uuid = org[:href].split('/').last
    @service.get_organization(@org_uuid).body
  end

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

  tests('#get_organizations_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_organizations_from_query(:format => format).body
        end
        key = (format == 'references') ? 'OrganizationReference' : 'OrganizationRecord'
        tests("#body.key?(:#{key})").returns(true) { @body.key?(key.to_sym) }
      end
    end
  end

  tests('retrieve non-existent Org').raises(Fog::Compute::VcloudDirector::Forbidden) do
    @service.get_organization('00000000-0000-0000-0000-000000000000')
  end

end

Version data entries

57 entries across 55 versions & 7 rubygems

Version Path
fog-2.3.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-ifeel-2.2.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-2.2.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-2.1.0 tests/vcloud_director/requests/compute/organization_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/tests/vcloud_director/requests/compute/organization_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/tests/vcloud_director/requests/compute/organization_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/tests/vcloud_director/requests/compute/organization_tests.rb
fog-1.42.1 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.2.2 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.2.1 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.2.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.1.10 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.1.9 tests/vcloud_director/requests/compute/organization_tests.rb
fog-2.0.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-1.42.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-1.41.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-1.40.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-1.39.0 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.1.8 tests/vcloud_director/requests/compute/organization_tests.rb
fog-vcloud-director-0.1.7 tests/vcloud_director/requests/compute/organization_tests.rb