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

77 lines
1.7 KiB
Ruby

Shindo.tests('Fog::Compute[:google] | server requests', ['google']) do
@google = Fog::Compute[:google]
@insert_server_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'user' => String,
'startTime' => String,
'insertTime' => String,
'operationType' => String,
'status' => String,
'progress' => Integer
}
@get_server_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'creationTimestamp' => String,
'name' => String,
'image' => String,
'machineType' => String,
'status' => String,
'zone' => String,
'disks' => [],
'networkInterfaces' => []
}
@delete_server_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'status' => String,
'user' => String,
'targetId' => String,
'progress' => Integer,
'insertTime' => String,
'startTime' => String,
'operationType' => String
}
@list_servers_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'items' => []
}
tests('success') do
server_name = 'new-server-test'
tests("#insert_server").formats(@insert_server_format) do
@google.insert_server(server_name).body
end
tests("#get_server").formats(@get_server_format) do
@google.get_server(server_name).body
end
tests("#list_servers").formats(@list_servers_format) do
@google.list_servers.body
end
tests("#delete_server").formats(@delete_server_format) do
@google.delete_server(server_name).body
end
end
end