2009-08-17 18:55:30 -04:00
|
|
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2009-07-03 15:09:38 -04:00
|
|
|
|
|
|
|
describe 'EC2.describe_images' do
|
|
|
|
|
|
|
|
it "should return proper attributes with no params" do
|
2009-08-18 01:39:44 -04:00
|
|
|
actual = ec2.describe_images
|
2009-08-01 04:15:44 -04:00
|
|
|
actual.body['requestId'].should be_a(String)
|
|
|
|
image = actual.body['imagesSet'].first
|
|
|
|
image['architecture'].should be_a(String)
|
|
|
|
image['imageId'].should be_a(String)
|
|
|
|
image['imageLocation'].should be_a(String)
|
|
|
|
image['imageOwnerId'].should be_a(String)
|
|
|
|
image['imageState'].should be_a(String)
|
|
|
|
image['imageType'].should be_a(String)
|
|
|
|
[false, true].should include(image['isPublic'])
|
|
|
|
image['kernelId'].should be_a(String) if image['kernelId']
|
|
|
|
image['platform'].should be_a(String) if image['platform']
|
|
|
|
image['ramdiskId'].should be_a(String) if image['ramdiskId']
|
2009-07-03 15:09:38 -04:00
|
|
|
end
|
|
|
|
|
2009-07-22 00:51:32 -04:00
|
|
|
it "should return proper attributes with params" do
|
2009-08-18 01:39:44 -04:00
|
|
|
actual = ec2.describe_images('ImageId' => 'ami-5ee70037')
|
2009-08-01 04:15:44 -04:00
|
|
|
actual.body['requestId'].should be_a(String)
|
|
|
|
image = actual.body['imagesSet'].first
|
|
|
|
image['architecture'].should be_a(String)
|
|
|
|
image['imageId'].should be_a(String)
|
|
|
|
image['imageLocation'].should be_a(String)
|
|
|
|
image['imageOwnerId'].should be_a(String)
|
|
|
|
image['imageState'].should be_a(String)
|
|
|
|
image['imageType'].should be_a(String)
|
|
|
|
[false, true].should include(image['isPublic'])
|
|
|
|
image['kernelId'].should be_a(String) if image['kernelId']
|
|
|
|
image['platform'].should be_a(String) if image['platform']
|
|
|
|
image['ramdiskId'].should be_a(String) if image['ramdiskId']
|
2009-07-22 00:51:32 -04:00
|
|
|
end
|
2009-07-03 15:09:38 -04:00
|
|
|
|
|
|
|
end
|