Sha256: 53f2e339bb5f8d3ce201d51a694ea0945a54d15c190cd05784ac83559764c7d8

Contents?: true

Size: 984 Bytes

Versions: 13

Compression:

Stored size: 984 Bytes

Contents

Shindo.tests('Fog::Compute::RackspaceV2 | flavor_tests', ['rackspace']) do

  pending if Fog.mocking?

  FLAVOR_FORMAT = {
    'id' => String,
    'name' => String,
    'ram' => Fog::Nullable::Integer,
    'disk' => Fog::Nullable::Integer,
    'vcpus' => Fog::Nullable::Integer,
    'links' => [{
      'rel' => String,
      'href' => String
    }]
  }

  LIST_FLAVOR_FORMAT = {
    'flavors' => [FLAVOR_FORMAT]
  }

  GET_FLAVOR_FORMAT = {
    'flavor' => FLAVOR_FORMAT.merge({
      'OS-FLV-DISABLED:disabled' => Fog::Boolean,
      'rxtx_factor' => Float,
      'swap' => Integer
    })
  }

  service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
  flavor_id = nil

  tests('success') do
    tests('#list_flavors').formats(LIST_FLAVOR_FORMAT) do
      body = service.list_flavors.body
      flavor_id = body['flavors'][0]['id']
      body
    end

    tests('#get_flavor').formats(GET_FLAVOR_FORMAT) do
      service.get_flavor(flavor_id).body
    end
  end
end

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
fog-nirvanix-1.8.2 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-nirvanix-1.8.1 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-parser-fix-1.6.1 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-test-again-1.6.0 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-parser-fix-1.6.0 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-maestrodev-1.8.0.20130114204828 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-maestrodev-1.8.0.20130111070250 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-maestrodev-1.8.0.20130109172219 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-sgonyea-1.8.1 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-1.8.0 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-1.7.0 tests/rackspace/requests/compute_v2/flavor_tests.rb
fog-1.6.0 tests/rackspace/requests/compute_v2/flavor_tests.rb