Sha256: 34717445223f756decaf8b56ad8ba4724bc0ea78abd8b366cb2626b59e43b752

Contents?: true

Size: 1.83 KB

Versions: 20

Compression:

Stored size: 1.83 KB

Contents

Shindo.tests('Brightbox::Compute | image requests', ['brightbox']) do

  tests('success') do

    ## Difficult to test without having uploaded an Image to your account to register
    # creation_options = {
    #   "arch" => "i686",
    #   "source" => "fnord"
    # }
    # tests("#create_image(#{creation_options.inspect})").formats(Brightbox::Compute::Formats::Full::IMAGE) do
    #   data = Brightbox[:compute].create_image(creation_options)
    #   @image_id = data["id"]
    #   data
    # end

    # Brightbox[:compute].images.get(@image_id).wait_for { ready? }

    tests("#list_images").formats(Brightbox::Compute::Formats::Collection::IMAGES) do
      pending if Fog.mocking?
      data = Brightbox[:compute].list_images
      @image_id = data.first["id"]
      data
    end

    tests("#get_image('#{@image_id}')").formats(Brightbox::Compute::Formats::Full::IMAGE) do
      pending if Fog.mocking?
      Brightbox[:compute].get_image(@image_id)
    end

    ## Until Image creation can be automated, we shouldn't be updating Images randomly
    # update_options = {}
    # tests("#update_image('#{@image_id}', #{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::IMAGE) do
    #   Brightbox[:compute].update_image(@image_id, :name => "New name from Fog test")
    # end

    ## Same as other tests - can't be deleting them unless part of the test run
    # tests("#destroy_server('#{@image_id}')").formats(Brightbox::Compute::Formats::Full::IMAGE) do
    #   Brightbox[:compute].destroy_image(@image_id)
    # end

  end

  tests('failure') do

    tests("#get_image('img-00000')").raises(Excon::Errors::NotFound) do
      pending if Fog.mocking?
      Brightbox[:compute].get_image('img-00000')
    end

    tests("#get_image").raises(ArgumentError) do
      pending if Fog.mocking?
      Brightbox[:compute].get_image
    end

  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
fog-0.8.2 tests/compute/requests/brightbox/image_tests.rb
fog-0.8.1 tests/compute/requests/brightbox/image_tests.rb
fog-0.8.0 tests/compute/requests/brightbox/image_tests.rb
fog-0.7.2 tests/compute/requests/brightbox/image_tests.rb
fog-0.7.1 tests/compute/requests/brightbox/image_tests.rb
fog-0.7.0 tests/compute/requests/brightbox/image_tests.rb
fog-0.6.0 tests/compute/requests/brightbox/image_tests.rb
fog-0.5.3 tests/compute/requests/brightbox/image_tests.rb
fog-0.5.2 tests/compute/requests/brightbox/image_tests.rb
fog-0.5.1 tests/compute/requests/brightbox/image_tests.rb
fog-0.5.0 tests/compute/requests/brightbox/image_tests.rb
phpfog-fog-0.4.1.3 tests/compute/requests/brightbox/image_tests.rb
phpfog-fog-0.4.1.2 tests/compute/requests/brightbox/image_tests.rb
phpfog-fog-0.4.1.1 tests/compute/requests/brightbox/image_tests.rb
phpfog-fog-0.4.1 tests/compute/requests/brightbox/image_tests.rb
fog-0.4.1 tests/compute/requests/brightbox/image_tests.rb
fog-0.4.0 tests/compute/requests/brightbox/image_tests.rb
fog-0.3.34 tests/brightbox/requests/compute/image_tests.rb
fog-0.3.33 tests/brightbox/requests/compute/image_tests.rb
fog-0.3.32 tests/brightbox/requests/compute/image_tests.rb