1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/bluebox/requests/compute/template_tests.rb

38 lines
979 B
Ruby
Raw Normal View History

Shindo.tests('Fog::Compute[:bluebox] | template requests', ['bluebox']) do
2010-06-04 00:32:59 -04:00
@template_format = {
'created' => String,
'description' => String,
'id' => String,
2012-02-16 21:43:25 -05:00
'public' => Fog::Boolean,
'locations' => [ String ],
'status' => String
2010-06-04 00:32:59 -04:00
}
tests('success') do
2012-02-16 21:43:25 -05:00
@template_id = compute_providers[:bluebox][:server_attributes][:image_id]
2010-06-04 00:32:59 -04:00
tests("get_template('#{@template_id}')").formats(@template_format) do
pending if Fog.mocking?
Fog::Compute[:bluebox].get_template(@template_id).body
2010-06-04 00:32:59 -04:00
end
tests("get_templates").formats([@template_format]) do
pending if Fog.mocking?
Fog::Compute[:bluebox].get_templates.body
2010-06-04 00:32:59 -04:00
end
end
tests('failure') do
tests("get_template('00000000-0000-0000-0000-000000000000')").raises(Fog::Compute::Bluebox::NotFound) do
pending if Fog.mocking?
Fog::Compute[:bluebox].get_template('00000000-0000-0000-0000-000000000000')
2010-06-04 00:32:59 -04:00
end
end
end