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/operation_tests.rb
2013-01-16 17:55:36 -08:00

58 lines
1.4 KiB
Ruby

Shindo.tests('Fog::Compute[:google] | operation requests', ['gce']) do
@google = Fog::Compute[:gce]
@insert_operation_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'targetId' => String,
'status' => String,
'user' => String,
'progress' => Integer,
'insertTime' => String,
'startTime' => String,
'operationType' => String
}
@get_operation_format = {
'kind' => String,
'error' => { 'errors' => [] },
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'status' => String,
'user' => String,
'progress' => Integer,
'insertTime' => String,
'startTime' => String,
'httpErrorStatusCode' => Integer,
'httpErrorMessage' => String,
'operationType' => String
}
@list_operations_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'nextPageToken' => String,
'items' => []
}
tests('success') do
tests("#get_operation").formats(@get_operation_format) do
operation_name = @google.list_operations.body["items"][0]["name"]
@google.get_operation(operation_name).body
end
tests("#list_operations").formats(@list_operations_format) do
@google.list_operations.body
end
end
end