Sha256: 62c1a13c2b74fe8175d395b24f9e973edaf4cb5d395b92655b822e6cd05dc7ea

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

Shindo.tests('Fog::Compute[:profitbricks] | flavor request', ['profitbricks', 'compute']) do

  @flavor_format = {
    'flavorId'   => String,
    'flavorName' => String,
    'ram'        => Integer,
    'cores'      => Integer
  }

  service = Fog::Compute[:profitbricks]

  tests('success') do

    # Not yet implemented
    # tests('#create_flavor').formats(@flavor_format) do
    #   puts '#create_flavor'
    #   data = service.create_flavor('FogFlavorTest', 4096, 2)
    #   data.body['createFlavorResponse']
    # end

    tests('#get_all_flavors').formats(@flavor_format) do
      # puts '#get_all_flavors'
      data = service.get_all_flavors
      @flavor_id = data.body['getAllFlavorsResponse'][0]['flavorId']
      data.body['getAllFlavorsResponse'][0]
    end

    tests('#get_flavor').formats(@flavor_format) do
      # puts '#get_flavor'
      data = service.get_flavor(@flavor_id)
      data.body['getFlavorResponse']
    end

  end

  tests('failure') do
    tests('#get_flavor').raises(Fog::Errors::NotFound) do
      # puts '#get_flavor'
      data = service.get_flavor('00000000-0000-0000-0000-000000000000')
      data.body['getRegionResponse']
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fog-profitbricks-2.0.1 tests/profitbricks/requests/compute/flavor_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-profitbricks-0.0.5/tests/profitbricks/requests/compute/flavor_tests.rb
fog-profitbricks-0.0.5 tests/profitbricks/requests/compute/flavor_tests.rb
fog-profitbricks-0.0.4 tests/profitbricks/requests/compute/flavor_tests.rb
fog-profitbricks-0.0.3 tests/profitbricks/requests/compute/flavor_tests.rb
fog-profitbricks-0.0.2 tests/profitbricks/requests/compute/flavor_tests.rb
fog-profitbricks-0.0.1 tests/profitbricks/requests/compute/flavor_tests.rb