Sha256: c983849246178c251b25d53e846bab4f8747324c56755eae2fb69ee94bed7c51

Contents?: true

Size: 1.79 KB

Versions: 37

Compression:

Stored size: 1.79 KB

Contents

Shindo.tests('Fog::Compute[:openstack] | limits requests', ['openstack']) do
  @rate_limit_format = {
    'regex' => String,
    'uri'   => String,
    'limit' => Array
  }

  @rate_limit_usage_format = {
    'next-available' => String,
    'unit'           => String,
    'verb'           => String,
    'remaining'      => Fixnum,
    'value'          => Fixnum
  }

  @absolute_limits_format = {
    'maxServerMeta'             => Fixnum,
    'maxTotalInstances'         => Fixnum,
    'maxPersonality'            => Fixnum,
    'maxImageMeta'              => Fixnum,
    'maxPersonalitySize'        => Fixnum,
    'maxSecurityGroupRules'     => Fixnum,
    'maxTotalKeypairs'          => Fixnum,
    'maxSecurityGroups'         => Fixnum,
    'maxTotalCores'             => Fixnum,
    'maxTotalFloatingIps'       => Fixnum,
    'maxTotalRAMSize'           => Fixnum,
    'totalCoresUsed'            => Fixnum,
    'totalRAMUsed'              => Fixnum,
    'totalInstancesUsed'        => Fixnum,
    'totalSecurityGroupsUsed'   => Fixnum,
    'totalFloatingIpsUsed'      => Fixnum
  }

  @limits_format = {
    'rate'     => Array,
    'absolute' => Hash
  }

  tests('success') do
    tests('#get_limits') do
      tests('format').formats(@limits_format) do
        Fog::Compute[:openstack].get_limits.body['limits']
      end

      tests('rate limit format').formats(@rate_limit_format) do
        Fog::Compute[:openstack].get_limits.body['limits']['rate'].first
      end

      tests('rate limit usage format').formats(@rate_limit_usage_format) do
        Fog::Compute[:openstack].get_limits.body['limits']['rate'].first['limit'].first
      end

      tests('absolute limits format').formats(@absolute_limits_format) do
        Fog::Compute[:openstack].get_limits.body['limits']['absolute']
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 5 rubygems

Version Path
fog-openstack-0.1.7 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.6 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.5 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.4 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.3 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.2 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.1 tests/openstack/requests/compute/limit_tests.rb
fog-openstack-0.1.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.37.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.36.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.35.0 tests/openstack/requests/compute/limit_tests.rb
fog-2.0.0.pre.0 tests/openstack/requests/compute/limit_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/openstack/requests/compute/limit_tests.rb
fog-1.34.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.33.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.32.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.31.0 tests/openstack/requests/compute/limit_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/openstack/requests/compute/limit_tests.rb
fog-1.30.0 tests/openstack/requests/compute/limit_tests.rb
fog-1.29.0 tests/openstack/requests/compute/limit_tests.rb