2012-07-30 16:50:16 -04:00
|
|
|
Shindo.tests('Fog::Compute::RackspaceV2 | flavor_tests', ['rackspace']) do
|
|
|
|
|
2013-01-11 16:06:58 -05:00
|
|
|
flavor_format = {
|
2012-07-30 16:50:16 -04:00
|
|
|
'id' => String,
|
|
|
|
'name' => String,
|
|
|
|
'ram' => Fog::Nullable::Integer,
|
|
|
|
'disk' => Fog::Nullable::Integer,
|
|
|
|
'vcpus' => Fog::Nullable::Integer,
|
|
|
|
'links' => [{
|
|
|
|
'rel' => String,
|
|
|
|
'href' => String
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2013-01-11 16:06:58 -05:00
|
|
|
list_flavor_format = {
|
|
|
|
'flavors' => [flavor_format]
|
2012-07-30 16:50:16 -04:00
|
|
|
}
|
|
|
|
|
2013-01-11 16:06:58 -05:00
|
|
|
get_flavor_format = {
|
|
|
|
'flavor' => flavor_format.merge({
|
2013-06-26 10:27:15 -04:00
|
|
|
'OS-FLV-EXT-DATA:ephemeral' => Integer,
|
2012-07-30 16:50:16 -04:00
|
|
|
'rxtx_factor' => Float,
|
|
|
|
'swap' => Integer
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
|
|
|
|
flavor_id = nil
|
|
|
|
|
|
|
|
tests('success') do
|
2013-01-11 16:06:58 -05:00
|
|
|
tests('#list_flavors').formats(list_flavor_format) do
|
2012-07-30 16:50:16 -04:00
|
|
|
body = service.list_flavors.body
|
|
|
|
flavor_id = body['flavors'][0]['id']
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
2013-08-26 23:39:12 -04:00
|
|
|
tests('#list_flavors_detail').formats(list_flavor_format) do
|
|
|
|
body = service.list_flavors_detail.body
|
|
|
|
flavor_id = body['flavors'][0]['id']
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
2013-01-11 16:06:58 -05:00
|
|
|
tests('#get_flavor').formats(get_flavor_format) do
|
2012-07-30 16:50:16 -04:00
|
|
|
service.get_flavor(flavor_id).body
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|