Sha256: dc435ed46e35bf6aaaf1a61fac3917480d6e04925a14bea36cdab2cd5bc671d1

Contents?: true

Size: 1.64 KB

Versions: 91

Compression:

Stored size: 1.64 KB

Contents

Shindo.tests("Fog::CDN[:hp] | container requests", ['hp']) do

  @cdn_containers_format = [{
    'x-cdn-ssl-uri' => String,
    'cdn_enabled'   => Fog::Boolean,
    'name'          => String,
    'x-cdn-uri'     => String,
    'ttl'           => Integer,
    'log_retention' => Fog::Boolean
  }]

  tests('success') do

    tests("#put_container('fogcdncontainertests')").succeeds do
      Fog::CDN[:hp].put_container('fogcdncontainertests')
    end

    tests("duplicate #put_container('fogcdncontainertests')").succeeds do
      Fog::CDN[:hp].put_container('fogcdncontainertests')
    end

    tests("#get_containers").formats(@cdn_containers_format) do
      Fog::CDN[:hp].get_containers.body
    end

    tests("#post_container('fogcdncontainertests', {'x-ttl' => 3200})").succeeds do
      Fog::CDN[:hp].post_container('fogcdncontainertests', {'x-ttl' => 3200})
    end

    tests("#head_container('fogcdncontainertests')").succeeds do
      Fog::CDN[:hp].head_container('fogcdncontainertests')
    end

    tests("#delete_container('fogcdncontainertests')").succeeds do
      Fog::CDN[:hp].delete_container('fogcdncontainertests')
    end

  end

  tests('failure') do

    tests("#post_container('fognoncdncontainer', {'x-ttl' => 3200})").raises(Fog::CDN::HP::NotFound) do
      Fog::CDN[:hp].post_container('fogcdnnoncontainer', {'x-ttl' => 3200})
    end

    tests("#head_container('fognoncdncontainer')").raises(Fog::CDN::HP::NotFound) do
      Fog::CDN[:hp].head_container('fognoncdncontainer')
    end

    tests("#delete_container('fognoncdncontainer')").raises(Fog::CDN::HP::NotFound) do
      Fog::CDN[:hp].delete_container('fognoncdncontainer')
    end

  end

end

Version data entries

91 entries across 91 versions & 9 rubygems

Version Path
fog-1.38.0 tests/hp/requests/cdn/container_tests.rb
fog-1.37.0 tests/hp/requests/cdn/container_tests.rb
fog-1.36.0 tests/hp/requests/cdn/container_tests.rb
fog-1.35.0 tests/hp/requests/cdn/container_tests.rb
fog-2.0.0.pre.0 tests/hp/requests/cdn/container_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/hp/requests/cdn/container_tests.rb
fog-1.34.0 tests/hp/requests/cdn/container_tests.rb
fog-1.33.0 tests/hp/requests/cdn/container_tests.rb
fog-1.32.0 tests/hp/requests/cdn/container_tests.rb
fog-1.31.0 tests/hp/requests/cdn/container_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/hp/requests/cdn/container_tests.rb
fog-1.30.0 tests/hp/requests/cdn/container_tests.rb
fog-1.29.0 tests/hp/requests/cdn/container_tests.rb
fog-1.28.0 tests/hp/requests/cdn/container_tests.rb
fog-1.27.0 tests/hp/requests/cdn/container_tests.rb
fog-1.26.0 tests/hp/requests/cdn/container_tests.rb
fog-1.25.0 tests/hp/requests/cdn/container_tests.rb
nsidc-fog-1.24.1 tests/hp/requests/cdn/container_tests.rb
fog-1.24.0 tests/hp/requests/cdn/container_tests.rb
ns-fog-1.22.11 tests/hp/requests/cdn/container_tests.rb