fog 0.0.91 → 0.0.92
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +39 -39
- data/fog.gemspec +17 -16
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/elb.rb +4 -0
- data/lib/fog/aws/models/ec2/snapshot.rb +3 -0
- data/lib/fog/aws/parsers/ec2/create_snapshot.rb +5 -1
- data/lib/fog/aws/parsers/ec2/describe_snapshots.rb +5 -1
- data/lib/fog/aws/parsers/elb/create_load_balancer.rb +26 -0
- data/lib/fog/aws/parsers/elb/delete_load_balancer.rb +24 -0
- data/lib/fog/aws/parsers/s3/access_control_list.rb +46 -0
- data/lib/fog/aws/requests/ec2/create_snapshot.rb +11 -7
- data/lib/fog/aws/requests/ec2/describe_snapshots.rb +3 -0
- data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +0 -1
- data/lib/fog/aws/requests/ec2/run_instances.rb +0 -2
- data/lib/fog/aws/requests/ec2/terminate_instances.rb +0 -1
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +57 -0
- data/lib/fog/aws/requests/elb/delete_load_balancer.rb +40 -0
- data/lib/fog/aws/requests/s3/copy_object.rb +0 -1
- data/lib/fog/aws/requests/s3/get_bucket.rb +2 -3
- data/lib/fog/aws/requests/s3/get_bucket_acl.rb +53 -0
- data/lib/fog/aws/requests/s3/get_object.rb +1 -31
- data/lib/fog/aws/requests/s3/get_object_acl.rb +58 -0
- data/lib/fog/aws/requests/s3/get_object_torrent.rb +55 -0
- data/lib/fog/aws/requests/s3/get_object_url.rb +54 -0
- data/lib/fog/aws/requests/s3/put_bucket_acl.rb +80 -0
- data/lib/fog/aws/s3.rb +8 -2
- data/lib/fog/collection.rb +1 -1
- data/lib/fog/connection.rb +7 -5
- data/lib/fog/model.rb +5 -2
- data/lib/fog/rackspace/files.rb +2 -2
- data/lib/fog/rackspace/requests/files/get_object.rb +1 -1
- data/lib/fog/terremark/parsers/shared/get_internet_services.rb +2 -2
- data/lib/fog/terremark/parsers/shared/get_node_services.rb +3 -0
- data/lib/fog/terremark/parsers/shared/vapp.rb +33 -3
- data/lib/fog/terremark/requests/shared/delete_internet_service.rb +0 -12
- data/lib/fog/terremark/requests/shared/delete_node_service.rb +0 -12
- data/lib/fog/terremark/requests/shared/delete_vapp.rb +0 -12
- data/lib/fog/terremark/shared.rb +0 -1
- data/spec/aws/models/s3/file_spec.rb +2 -2
- data/spec/aws/models/s3/files_spec.rb +2 -2
- data/spec/aws/requests/ec2/get_console_output_spec.rb +4 -4
- data/spec/aws/requests/s3/get_bucket_spec.rb +9 -9
- data/tests/aws/helper.rb +105 -0
- data/tests/aws/requests/ec2/address_tests.rb +88 -0
- data/tests/aws/requests/ec2/snapshot_tests.rb +50 -0
- data/tests/aws/requests/ec2/volume_tests.rb +84 -0
- data/tests/helper.rb +21 -6
- data/tests/helper_tests.rb +38 -7
- data/tests/rackspace/requests/servers/create_image_tests.rb +1 -1
- data/tests/rackspace/requests/servers/create_server_tests.rb +1 -1
- data/tests/rackspace/requests/servers/delete_image_tests.rb +1 -4
- data/tests/rackspace/requests/servers/delete_server_tests.rb +1 -4
- data/tests/rackspace/requests/servers/get_flavor_details_tests.rb +2 -5
- data/tests/rackspace/requests/servers/get_image_details_tests.rb +2 -5
- data/tests/rackspace/requests/servers/get_server_details_tests.rb +2 -5
- data/tests/rackspace/requests/servers/list_addresses_tests.rb +2 -5
- data/tests/rackspace/requests/servers/list_flavors_detail_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_flavors_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_images_detail_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_images_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_private_addresses_tests.rb +2 -5
- data/tests/rackspace/requests/servers/list_public_addresses_tests.rb +2 -5
- data/tests/rackspace/requests/servers/list_servers_detail_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_servers_tests.rb +1 -1
- data/tests/rackspace/requests/servers/reboot_server_tests.rb +1 -4
- data/tests/rackspace/requests/servers/update_server_tests.rb +2 -5
- data/tests/slicehost/requests/create_slice_tests.rb +1 -1
- data/tests/slicehost/requests/delete_slice_tests.rb +1 -4
- data/tests/slicehost/requests/get_backups_tests.rb +1 -2
- data/tests/slicehost/requests/get_flavor_tests.rb +2 -5
- data/tests/slicehost/requests/get_flavors_tests.rb +1 -1
- data/tests/slicehost/requests/get_image_tests.rb +2 -5
- data/tests/slicehost/requests/get_images_tests.rb +1 -1
- data/tests/slicehost/requests/get_slice_tests.rb +2 -5
- data/tests/slicehost/requests/get_slices_tests.rb +1 -1
- data/tests/slicehost/requests/reboot_slice_tests.rb +2 -5
- metadata +19 -18
- data/spec/aws/requests/ec2/allocate_address_spec.rb +0 -18
- data/spec/aws/requests/ec2/associate_address_spec.rb +0 -43
- data/spec/aws/requests/ec2/attach_volume_spec.rb +0 -51
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +0 -36
- data/spec/aws/requests/ec2/create_volume_spec.rb +0 -23
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +0 -34
- data/spec/aws/requests/ec2/delete_volume_spec.rb +0 -26
- data/spec/aws/requests/ec2/describe_addresses_spec.rb +0 -38
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +0 -50
- data/spec/aws/requests/ec2/describe_volumes_spec.rb +0 -50
- data/spec/aws/requests/ec2/detach_volume_spec.rb +0 -41
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +0 -36
- data/spec/aws/requests/ec2/release_address_spec.rb +0 -26
@@ -0,0 +1,88 @@
|
|
1
|
+
Shindo.tests('AWS::EC2 | address requests', ['aws']) do
|
2
|
+
|
3
|
+
@server = AWS[:ec2].servers.create(:image_id => GENTOO_AMI)
|
4
|
+
@server.wait_for { ready? }
|
5
|
+
|
6
|
+
tests('success') do
|
7
|
+
|
8
|
+
@public_ip = nil
|
9
|
+
|
10
|
+
test('#allocate_address') do
|
11
|
+
@data = AWS[:ec2].allocate_address.body
|
12
|
+
@public_ip = @data['publicIp']
|
13
|
+
has_format(
|
14
|
+
@data,
|
15
|
+
{
|
16
|
+
'publicIp' => String,
|
17
|
+
'requestId' => String
|
18
|
+
}
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
test("#describe_addresses") do
|
23
|
+
@data = AWS[:ec2].describe_addresses.body
|
24
|
+
has_format(@data, AWS::EC2::Formats::ADDRESSES)
|
25
|
+
end
|
26
|
+
|
27
|
+
test("#describe_addresses('#{@public_ip}')") do
|
28
|
+
@data = AWS[:ec2].describe_addresses(@public_ip).body
|
29
|
+
has_format(@data, AWS::EC2::Formats::ADDRESSES)
|
30
|
+
end
|
31
|
+
|
32
|
+
test("#associate_address('#{@server.identity}', '#{@public_ip}')") do
|
33
|
+
@data = AWS[:ec2].associate_address(@server.identity, @public_ip).body
|
34
|
+
has_format(@data, AWS::EC2::Formats::BASIC)
|
35
|
+
end
|
36
|
+
|
37
|
+
test("#disassociate_address('#{@public_ip}')") do
|
38
|
+
@data = AWS[:ec2].disassociate_address(@public_ip).body
|
39
|
+
has_format(@data, AWS::EC2::Formats::BASIC)
|
40
|
+
end
|
41
|
+
|
42
|
+
test("#release_address('#{@public_ip}')") do
|
43
|
+
@data = AWS[:ec2].release_address(@public_ip).body
|
44
|
+
has_format(@data, AWS::EC2::Formats::BASIC)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
tests ('failure') do
|
49
|
+
|
50
|
+
@address = AWS[:ec2].addresses.create
|
51
|
+
|
52
|
+
test("#describe_addresses('127.0.0.1') raises BadRequest error") do
|
53
|
+
has_error(Excon::Errors::BadRequest) do
|
54
|
+
AWS[:ec2].describe_addresses('127.0.0.1')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
test("#associate_addresses('i-00000000', '#{@address.identity}') raises BadRequest error") do
|
59
|
+
has_error(Excon::Errors::BadRequest) do
|
60
|
+
AWS[:ec2].associate_address('i-00000000', @address.identity)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
test("#associate_addresses('#{@server.identity}', '127.0.0.1') raises BadRequest error") do
|
65
|
+
has_error(Excon::Errors::BadRequest) do
|
66
|
+
AWS[:ec2].associate_address(@server.identity, '127.0.0.1')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
test("#disassociate_addresses('127.0.0.1') raises BadRequest error") do
|
71
|
+
has_error(Excon::Errors::BadRequest) do
|
72
|
+
AWS[:ec2].disassociate_address('127.0.0.1')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
test("#release_address('127.0.0.1') raises BadRequest error") do
|
77
|
+
has_error(Excon::Errors::BadRequest) do
|
78
|
+
AWS[:ec2].release_address('127.0.0.1')
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
@address.destroy
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
@server.destroy
|
87
|
+
|
88
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
Shindo.tests('AWS::EC2 | snapshot requests', ['aws']) do
|
2
|
+
|
3
|
+
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
|
4
|
+
|
5
|
+
tests('success') do
|
6
|
+
|
7
|
+
@snapshot_id = nil
|
8
|
+
|
9
|
+
test("#create_snapshot(#{@volume.identity})") do
|
10
|
+
@data = AWS[:ec2].create_snapshot(@volume.identity).body
|
11
|
+
@snapshot_id = @data['snapshotId']
|
12
|
+
has_format(@data, AWS::EC2::Formats::SNAPSHOT.merge('progress' => NilClass, 'requestId' => String))
|
13
|
+
end
|
14
|
+
|
15
|
+
test("#describe_snapshots") do
|
16
|
+
AWS[:ec2].snapshots.get(@snapshot_id).wait_for { ready? }
|
17
|
+
@data = AWS[:ec2].describe_snapshots.body
|
18
|
+
has_format(@data, AWS::EC2::Formats::SNAPSHOTS)
|
19
|
+
end
|
20
|
+
|
21
|
+
test("#describe_snapshots('#{@snapshot_id}')") do
|
22
|
+
@data = AWS[:ec2].describe_snapshots(@snapshot_id).body
|
23
|
+
has_format(@data, AWS::EC2::Formats::SNAPSHOTS)
|
24
|
+
end
|
25
|
+
|
26
|
+
test("#delete_snapshots(#{@snapshot_id})") do
|
27
|
+
@data = AWS[:ec2].delete_snapshot(@snapshot_id).body
|
28
|
+
has_format(@data, AWS::EC2::Formats::BASIC)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
tests ('failure') do
|
33
|
+
|
34
|
+
test("#describe_snapshot('snap-00000000') raises BadRequest error") do
|
35
|
+
has_error(Excon::Errors::BadRequest) do
|
36
|
+
AWS[:ec2].describe_snapshots('snap-00000000')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
test("#delete_snapshot('snap-00000000') raises BadRequest error") do
|
41
|
+
has_error(Excon::Errors::BadRequest) do
|
42
|
+
AWS[:ec2].delete_snapshot('snap-00000000')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
@volume.destroy
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
Shindo.tests('AWS::EC2 | volume requests', ['aws']) do
|
2
|
+
|
3
|
+
@server = AWS[:ec2].servers.create(:image_id => GENTOO_AMI)
|
4
|
+
@server.wait_for { ready? }
|
5
|
+
|
6
|
+
tests('success') do
|
7
|
+
|
8
|
+
@volume_id = nil
|
9
|
+
|
10
|
+
test('#create_volume') do
|
11
|
+
@data = AWS[:ec2].create_volume(@server.availability_zone, 1).body
|
12
|
+
@volume_id = @data['volumeId']
|
13
|
+
has_format(@data, AWS::EC2::Formats::VOLUME)
|
14
|
+
end
|
15
|
+
|
16
|
+
test('#describe_volumes') do
|
17
|
+
@data = AWS[:ec2].describe_volumes.body
|
18
|
+
has_format(@data, AWS::EC2::Formats::VOLUMES)
|
19
|
+
end
|
20
|
+
|
21
|
+
test("#describe_volumes(#{@volume_id})") do
|
22
|
+
@data = AWS[:ec2].describe_volumes.body
|
23
|
+
has_format(@data, AWS::EC2::Formats::VOLUMES)
|
24
|
+
end
|
25
|
+
|
26
|
+
test("#attach_volume(#{@server.identity}, #{@volume_id}, '/dev/sdh')") do
|
27
|
+
@data = AWS[:ec2].attach_volume(@server.identity, @volume_id, '/dev/sdh').body
|
28
|
+
has_format(@data, AWS::EC2::Formats::VOLUME_ATTACHMENT)
|
29
|
+
end
|
30
|
+
|
31
|
+
test("#detach_volume('#{@volume_id}')") do
|
32
|
+
AWS[:ec2].volumes.get(@volume_id).wait_for { state == 'attached' }
|
33
|
+
@data = AWS[:ec2].detach_volume(@volume_id).body
|
34
|
+
has_format(@data, AWS::EC2::Formats::VOLUME_ATTACHMENT)
|
35
|
+
end
|
36
|
+
|
37
|
+
test("#delete_volume('#{@volume_id}')") do
|
38
|
+
AWS[:ec2].volumes.get(@volume_id).wait_for { ready? }
|
39
|
+
@data = AWS[:ec2].delete_volume(@volume_id).body
|
40
|
+
has_format(@data, AWS::EC2::Formats::BASIC)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
tests ('failure') do
|
45
|
+
|
46
|
+
@volume = AWS[:ec2].volumes.create(:availability_zone => @server.availability_zone, :size => 1)
|
47
|
+
|
48
|
+
test("#describe_volume('vol-00000000') raises BadRequest error") do
|
49
|
+
has_error(Excon::Errors::BadRequest) do
|
50
|
+
AWS[:ec2].describe_volumes('vol-00000000')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
test("#attach_volume('i-00000000', '#{@volume.identity}', '/dev/sdh') raises BadRequest error") do
|
55
|
+
has_error(Excon::Errors::BadRequest) do
|
56
|
+
AWS[:ec2].attach_volume('i-00000000', @volume.identity, '/dev/sdh')
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
test("#attach_volume('#{@server.identity}', 'vol-00000000', '/dev/sdh') raises BadRequest error") do
|
61
|
+
has_error(Excon::Errors::BadRequest) do
|
62
|
+
AWS[:ec2].attach_volume(@server.identity, 'vol-00000000', '/dev/sdh')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
test("#detach_volume('vol-00000000') raises BadRequest error") do
|
67
|
+
has_error(Excon::Errors::BadRequest) do
|
68
|
+
AWS[:ec2].detach_volume('vol-00000000')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
test("#delete_volume('vol-00000000') raises BadRequest error") do
|
73
|
+
has_error(Excon::Errors::BadRequest) do
|
74
|
+
AWS[:ec2].delete_volume('vol-00000000')
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
@volume.destroy
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
@server.destroy
|
83
|
+
|
84
|
+
end
|
data/tests/helper.rb
CHANGED
@@ -1,34 +1,49 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'fog'))
|
2
2
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'fog', 'bin'))
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
if ENV["FOG_MOCK"] == "true"
|
5
|
+
Fog.mock!
|
6
|
+
end
|
7
|
+
|
8
|
+
def has_error(error, &block)
|
9
|
+
begin
|
10
|
+
yield
|
11
|
+
@formatador.display_line("[red]did not raise #{error}[/]")
|
12
|
+
false
|
13
|
+
rescue error
|
14
|
+
true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def has_format(original_data, original_format)
|
6
19
|
valid = true
|
7
20
|
data = original_data.dup
|
21
|
+
format = original_format.dup
|
8
22
|
for key, value in format
|
9
23
|
valid &&= data.has_key?(key)
|
10
24
|
datum = data.delete(key)
|
25
|
+
format.delete(key)
|
11
26
|
case value
|
12
27
|
when Array
|
13
28
|
valid &&= datum.is_a?(Array)
|
14
29
|
for element in datum
|
15
30
|
type = value.first
|
16
31
|
if type.is_a?(Hash)
|
17
|
-
valid &&=
|
32
|
+
valid &&= has_format({:element => element}, {:element => type})
|
18
33
|
else
|
19
34
|
valid &&= element.is_a?(type)
|
20
35
|
end
|
21
36
|
end
|
22
37
|
when Hash
|
23
38
|
valid &&= datum.is_a?(Hash)
|
24
|
-
valid &&=
|
39
|
+
valid &&= has_format(datum, value)
|
25
40
|
else
|
26
41
|
valid &&= datum.is_a?(value)
|
27
42
|
end
|
28
43
|
end
|
29
|
-
valid &&= data.empty?
|
44
|
+
valid &&= data.empty? && format.empty?
|
30
45
|
unless valid
|
31
|
-
@formatador.display_line("[red]#{original_data.inspect} does not match #{
|
46
|
+
@formatador.display_line("[red]#{original_data.inspect} does not match #{original_format.inspect}[/]")
|
32
47
|
end
|
33
48
|
valid
|
34
49
|
end
|
data/tests/helper_tests.rb
CHANGED
@@ -1,18 +1,48 @@
|
|
1
1
|
Shindo.tests('test_helper', 'meta') do
|
2
|
-
|
2
|
+
|
3
|
+
tests('#has_error') do
|
4
|
+
|
5
|
+
tests('returns true') do
|
6
|
+
|
7
|
+
test('when expected error is raised') do
|
8
|
+
has_error(StandardError) { raise StandardError.new }
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
tests('returns false') do
|
14
|
+
|
15
|
+
test('when no error is raised') do
|
16
|
+
!has_error(StandardError) {}
|
17
|
+
end
|
18
|
+
|
19
|
+
test('when a different error is raised') do
|
20
|
+
begin
|
21
|
+
!has_error(StandardError) { raise Interrupt.new }
|
22
|
+
false
|
23
|
+
rescue Interrupt
|
24
|
+
true
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
tests('#has_format') do
|
3
33
|
|
4
34
|
tests('returns true') do
|
5
35
|
|
6
36
|
test('when format of value matches') do
|
7
|
-
|
37
|
+
has_format({:a => :b}, {:a => Symbol})
|
8
38
|
end
|
9
39
|
|
10
40
|
test('when format of nested array elements matches') do
|
11
|
-
|
41
|
+
has_format({:a => [:b, :c]}, {:a => [Symbol]})
|
12
42
|
end
|
13
43
|
|
14
44
|
test('when format of nested hash matches') do
|
15
|
-
|
45
|
+
has_format({:a => {:b => :c}}, {:a => {:b => Symbol}})
|
16
46
|
end
|
17
47
|
|
18
48
|
end
|
@@ -20,18 +50,19 @@ Shindo.tests('test_helper', 'meta') do
|
|
20
50
|
tests('returns false') do
|
21
51
|
|
22
52
|
test('when format of value does not match') do
|
23
|
-
!
|
53
|
+
!has_format({:a => :b}, {:a => String})
|
24
54
|
end
|
25
55
|
|
26
56
|
test('when not all keys are checked') do
|
27
|
-
!
|
57
|
+
!has_format({:a => :b}, {})
|
28
58
|
end
|
29
59
|
|
30
60
|
test('when some keys do not appear') do
|
31
|
-
!
|
61
|
+
!has_format({}, {:a => String})
|
32
62
|
end
|
33
63
|
|
34
64
|
end
|
35
65
|
|
36
66
|
end
|
67
|
+
|
37
68
|
end
|
@@ -13,7 +13,7 @@ Shindo.tests('Rackspace::Servers#create_server', 'rackspace') do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
test('has proper output format') do
|
16
|
-
|
16
|
+
has_format(@data, Rackspace::Servers::Formats::SERVER.merge('adminPass' => String))
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -20,11 +20,8 @@ Shindo.tests('Rackspace::Servers#delete_image', 'rackspace') do
|
|
20
20
|
tests('failure') do
|
21
21
|
|
22
22
|
test('raises NotFound error if image does not exist') do
|
23
|
-
|
23
|
+
has_error(Excon::Errors::NotFound) do
|
24
24
|
Rackspace[:servers].delete_image(0)
|
25
|
-
false
|
26
|
-
rescue Excon::Errors::NotFound
|
27
|
-
true
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
@@ -14,11 +14,8 @@ Shindo.tests('Rackspace::Servers#delete_server', 'rackspace') do
|
|
14
14
|
tests('failure') do
|
15
15
|
|
16
16
|
test('raises NotFound error if server does not exist') do
|
17
|
-
|
17
|
+
has_error(Excon::Errors::NotFound) do
|
18
18
|
Rackspace[:servers].delete_server(0)
|
19
|
-
false
|
20
|
-
rescue Excon::Errors::NotFound
|
21
|
-
true
|
22
19
|
end
|
23
20
|
end
|
24
21
|
|
@@ -6,18 +6,15 @@ Shindo.tests('Rackspace::Servers#get_flavor_details', 'rackspace') do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
test('has proper output format') do
|
9
|
-
|
9
|
+
has_format(@data, Rackspace::Servers::Formats::FLAVOR)
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|
13
13
|
tests('failure') do
|
14
14
|
|
15
15
|
test('raises NotFound error if flavor does not exist') do
|
16
|
-
|
16
|
+
has_error(Excon::Errors::NotFound) do
|
17
17
|
Rackspace[:servers].get_flavor_details(0)
|
18
|
-
false
|
19
|
-
rescue Excon::Errors::NotFound
|
20
|
-
true
|
21
18
|
end
|
22
19
|
end
|
23
20
|
|
@@ -6,18 +6,15 @@ Shindo.tests('Rackspace::Servers#get_image_details', 'rackspace') do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
test('has proper output format') do
|
9
|
-
|
9
|
+
has_format(@data, Rackspace::Servers::Formats::IMAGE)
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|
13
13
|
tests('failure') do
|
14
14
|
|
15
15
|
test('raises NotFound error if image does not exist') do
|
16
|
-
|
16
|
+
has_error(Excon::Errors::NotFound) do
|
17
17
|
Rackspace[:servers].get_image_details(0)
|
18
|
-
false
|
19
|
-
rescue Excon::Errors::NotFound
|
20
|
-
true
|
21
18
|
end
|
22
19
|
end
|
23
20
|
|