1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

basis for zone and global operations requests

This commit is contained in:
Nat Welch 2013-04-29 12:27:37 -07:00
parent c8a22dbc26
commit e8248d0a90
4 changed files with 58 additions and 19 deletions

View file

@ -18,6 +18,8 @@ module Fog
request :list_machine_types
request :list_networks
request :list_zones
request :list_global_operations
request :list_zone_operations
request :get_server
request :get_disk

View file

@ -0,0 +1,20 @@
module Fog
module Compute
class Google
class Mock
def list_global_operations
Fog::Mock.not_implemented
end
end
class Real
def list_global_operations
end
end
end
end
end

View file

@ -0,0 +1,20 @@
module Fog
module Compute
class Google
class Mock
def list_zone_operations
Fog::Mock.not_implemented
end
end
class Real
def list_zone_operations
end
end
end
end
end

View file

@ -2,21 +2,6 @@ Shindo.tests('Fog::Compute[:google] | operation requests', ['google']) do
@google = Fog::Compute[:google]
@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' => [] },
@ -34,7 +19,15 @@ Shindo.tests('Fog::Compute[:google] | operation requests', ['google']) do
'operationType' => String
}
@list_operations_format = {
@list_global_operations_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'nextPageToken' => String,
'items' => []
}
@list_zone_operations_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
@ -45,12 +38,16 @@ Shindo.tests('Fog::Compute[:google] | operation requests', ['google']) do
tests('success') do
tests("#get_operation").formats(@get_operation_format) do
operation_name = @google.list_operations.body["items"][0]["name"]
operation_name = @google.list_global_operations.body["items"][0]["name"]
@google.get_operation(operation_name).body
end
tests("#list_operations").formats(@list_operations_format) do
@google.list_operations.body
tests("#list_global_operations").formats(@list_global_operations_format) do
@google.list_global_operations.body
end
tests("#list_zone_operations").formats(@list_zone_operations_format) do
@google.list_zone_operations.body
end
end