Sha256: 5319f225c45dabaf268737b08af6ce862ba44d6ce27db72611820cbfd6c86fba

Contents?: true

Size: 1.89 KB

Versions: 14

Compression:

Stored size: 1.89 KB

Contents

Shindo.tests("Fog::Compute[:google] | image requests", ["google"]) do
  @google = Fog::Compute[:google]

  @insert_image_format = {
    "kind" => String,
    "id" => String,
    "selfLink" => String,
    "name" => String,
    "targetLink" => String,
    "status" => String,
    "user" => String,
    "progress" => Integer,
    "insertTime" => String,
    "startTime" => String,
    "operationType" => String
  }

  @get_image_format = {
    "kind" => String,
    "id" => String,
    "creationTimestamp" => String,
    "selfLink" => String,
    "name" => String,
    "description" => String,
    "sourceType" => String,
    "rawDisk" => {
      "containerType" => String,
      "source" => String
    }
  }

  @delete_image_format = {
    "kind" => String,
    "id" => String,
    "selfLink" => String,
    "name" => String,
    "targetLink" => String,
    "status" => String,
    "user" => String,
    "progress" => Integer,
    "insertTime" => String,
    "startTime" => String,
    "operationType" => String
  }

  @list_images_format = {
    "kind" => String,
    "id" => String,
    "selfLink" => String,
    "items" => [@get_image_format]
  }

  tests("success") do
    random_string = SecureRandom.hex
    image_name = "fog-test-image-#{random_string}"
    source = "https://www.google.com/images/srpr/logo4w.png"

    tests("#insert_image").formats(@insert_image_format) do
      pending if Fog.mocking?
      response = @google.insert_image(image_name, "rawDisk" => source).body
      wait_operation(@google, response)
      response
    end

    tests("#get_image").formats(@get_image_format) do
      pending if Fog.mocking?
      @google.get_image(image_name).body
    end

    tests("#list_images").formats(@list_images_format) do
      @google.list_images.body
    end

    tests("#delete_image").formats(@delete_image_format) do
      pending if Fog.mocking?
      @google.delete_image(image_name).body
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 tests/requests/compute/image_tests.rb
fog-google-0.5.5 tests/requests/compute/image_tests.rb
fog-google-0.5.4 tests/requests/compute/image_tests.rb
fog-google-0.5.3 tests/requests/compute/image_tests.rb
fog-google-0.5.2 tests/requests/compute/image_tests.rb
fog-google-0.5.1 tests/requests/compute/image_tests.rb
fog-google-0.5.0 tests/requests/compute/image_tests.rb
fog-google-0.4.2 tests/requests/compute/image_tests.rb
fog-google-0.4.1 tests/requests/compute/image_tests.rb
fog-google-0.4.0 tests/requests/compute/image_tests.rb
fog-google-0.3.2 tests/requests/compute/image_tests.rb
fog-google-0.3.1 tests/requests/compute/image_tests.rb
fog-google-0.3.0 tests/requests/compute/image_tests.rb
fog-google-0.2.0 tests/requests/compute/image_tests.rb