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

88 lines
2 KiB
Ruby
Raw Normal View History

2012-12-26 19:54:42 -05:00
Shindo.tests('Fog::Compute[:google] | disk requests', ['google']) do
2012-10-22 20:15:33 -04:00
2012-12-26 19:54:42 -05:00
@google = Fog::Compute[:google]
2012-10-22 20:15:33 -04:00
@insert_disk_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'status' => String,
'user' => String,
'progress' => Integer,
2013-04-16 23:42:54 -04:00
'zone' => String,
2012-10-22 20:15:33 -04:00
'insertTime' => String,
'startTime' => String,
'operationType' => String
}
@get_disk_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'creationTimestamp' => String,
'name' => String,
'zone' => String,
'status' => String,
'sizeGb' => String
}
@delete_disk_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'targetId' => String,
'status' => String,
'user' => String,
'progress' => Integer,
'insertTime' => String,
2013-04-16 23:42:54 -04:00
'zone' => String,
2012-10-22 20:15:33 -04:00
'startTime' => String,
'operationType' => String
}
@list_disks_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
2013-04-16 23:42:54 -04:00
'items' => [{
'kind'=> String,
'id'=> String,
'creationTimestamp'=>String,
'selfLink'=>String,
'name'=> String,
'sizeGb'=> String,
'zone'=> String,
'status'=>String,
}]
2012-10-22 20:15:33 -04:00
}
tests('success') do
disk_name = 'new-disk-test'
disk_size = '2'
2013-04-16 23:42:54 -04:00
zone_name = 'us-central1-a'
2012-10-22 20:15:33 -04:00
tests("#insert_disk").formats(@insert_disk_format) do
2013-04-16 23:42:54 -04:00
@google.insert_disk(disk_name, disk_size, zone_name).body
2012-10-22 20:15:33 -04:00
end
tests("#get_disk").formats(@get_disk_format) do
2013-04-16 23:42:54 -04:00
@google.get_disk(disk_name, zone_name).body
2012-10-22 20:15:33 -04:00
end
tests("#list_disks").formats(@list_disks_format) do
2013-04-16 23:42:54 -04:00
@google.list_disks(zone_name).body
2012-10-22 20:15:33 -04:00
end
tests("#delete_disk").formats(@delete_disk_format) do
2013-04-16 23:42:54 -04:00
@google.delete_disk(disk_name, zone_name).body
2012-10-22 20:15:33 -04:00
end
end
end