Sha256: 786672cf0138cb1e5187ff4b087e3241ecab2328c7e781453d8d88dddcb180c1

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

Shindo.tests('Fog::Compute[:openstack] | flavor requests', ['openstack']) do

  @flavor_format = {
    'id'          => String,
    'name'        => String,
    'disk'        => Integer,
    'ram'         => Integer,
    'links'       => Array,
    'swap'        => String,
    'rxtx_factor' => Fog::Nullable::Float,
    'OS-FLV-EXT-DATA:ephemeral'   => Integer,
    'vcpus'       => Integer
  }

  tests('success') do

    tests('#get_flavor_details(1)').formats(@flavor_format, false) do
      Fog::Compute[:openstack].get_flavor_details("1").body['flavor']
    end

    tests('#list_flavors').formats({'flavors' => [OpenStack::Compute::Formats::SUMMARY]}) do
      Fog::Compute[:openstack].list_flavors.body
    end

    tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}, false) do
      Fog::Compute[:openstack].list_flavors_detail.body
    end

    tests('#create_flavor(attributes)').formats({'flavor' => @flavor_format}) do
      attributes = {:flavor_id => '100', :name => 'shindo test flavor', :disk => 10, :ram => 10, :vcpus => 10, :swap => "0", :rxtx_factor => 1.0, :ephemeral => 0}
      Fog::Compute[:openstack].create_flavor(attributes).body
    end

    tests('delete_flavor(flavor_id)').succeeds do
      Fog::Compute[:openstack].delete_flavor('100')
    end

  end

  tests('failure') do

    tests('#get_flavor_details(0)').raises(Fog::Compute::OpenStack::NotFound) do
      Fog::Compute[:openstack].get_flavor_details("0")
    end

  end

end

Version data entries

7 entries across 7 versions & 4 rubygems

Version Path
fog-parser-fix-1.6.1 tests/openstack/requests/compute/flavor_tests.rb
fog-test-again-1.6.0 tests/openstack/requests/compute/flavor_tests.rb
fog-parser-fix-1.6.0 tests/openstack/requests/compute/flavor_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/openstack/requests/compute/flavor_tests.rb
fog-1.7.0 tests/openstack/requests/compute/flavor_tests.rb
fog-1.6.0 tests/openstack/requests/compute/flavor_tests.rb
fog-1.5.0 tests/openstack/requests/compute/flavor_tests.rb