2010-03-28 17:04:38 -07:00
|
|
|
Shindo.tests('Slicehost#delete_slice', 'slicehost') do
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
before do
|
|
|
|
@data = Slicehost[:slices].create_slice(1, 3, 'fogdeleteslice').body
|
|
|
|
@id = @data['id']
|
|
|
|
end
|
|
|
|
|
|
|
|
test('has proper output format') do
|
2010-05-01 15:08:44 -07:00
|
|
|
Fog.wait_for { Slicehost[:slices].get_slice(@id).body['status'] == 'active' }
|
2010-03-28 17:04:38 -07:00
|
|
|
Slicehost[:slices].delete_slice(@id)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
test('raises NotFound error if slice does not exist') do
|
|
|
|
begin
|
|
|
|
Slicehost[:slices].delete_slice(0)
|
|
|
|
false
|
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|