mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
slightly more accurate image test, although still failing.
This commit is contained in:
parent
dd39773a74
commit
8432d7ab77
4 changed files with 16 additions and 12 deletions
|
@ -15,8 +15,8 @@ module Fog
|
|||
def get_image(image_name)
|
||||
api_method = @compute.images.get
|
||||
parameters = {
|
||||
'project' => 'google',
|
||||
'image' => image_name
|
||||
'image' => image_name,
|
||||
'project' => @project,
|
||||
}
|
||||
|
||||
result = self.build_result(api_method, parameters)
|
||||
|
|
|
@ -12,18 +12,22 @@ module Fog
|
|||
|
||||
class Real
|
||||
|
||||
def insert_image(image_name, source_type)
|
||||
def insert_image(image_name, source)
|
||||
api_method = @compute.images.insert
|
||||
parameters = {
|
||||
'project' => @project,
|
||||
}
|
||||
body_object = {
|
||||
"name" => image_name,
|
||||
"sourceType" => source_type
|
||||
"sourceType" => "RAW",
|
||||
"source" => source,
|
||||
"preferredKernel" => '',
|
||||
}
|
||||
|
||||
result = self.build_result(api_method, parameters,
|
||||
body_object=body_object)
|
||||
result = self.build_result(
|
||||
api_method,
|
||||
parameters,
|
||||
body_object=body_object)
|
||||
response = self.build_response(result)
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ module Fog
|
|||
def list_images
|
||||
api_method = @compute.images.list
|
||||
parameters = {
|
||||
'project' => 'google'
|
||||
'project' => @project
|
||||
}
|
||||
|
||||
result = self.build_result(api_method, parameters)
|
||||
|
|
|
@ -54,15 +54,15 @@ Shindo.tests('Fog::Compute[:google] | image requests', ['google']) do
|
|||
|
||||
tests('success') do
|
||||
|
||||
image_name = 'gcel-12-04-v20130325'
|
||||
source_type = 'RAW'
|
||||
image_name = 'test-image'
|
||||
source = 'https://www.google.com/images/srpr/logo4w.png'
|
||||
|
||||
tests("#insert_image").formats(@insert_image_format) do
|
||||
@google.insert_image(image_name, source_type).body
|
||||
@google.insert_image(image_name, source).body
|
||||
end
|
||||
|
||||
tests("#get_image").formats(@get_image_format) do
|
||||
@google.insert_image(image_name, source_type)
|
||||
@google.insert_image(image_name, source)
|
||||
@google.get_image(image_name).body
|
||||
end
|
||||
|
||||
|
@ -71,7 +71,7 @@ Shindo.tests('Fog::Compute[:google] | image requests', ['google']) do
|
|||
end
|
||||
|
||||
tests("#delete_image").formats(@delete_image_format) do
|
||||
@google.insert_image(image_name, source_type)
|
||||
@google.insert_image(image_name, source)
|
||||
@google.delete_image(image_name).body
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue