Sha256: 4a0d40e1cf7a013c1ca628c13129512d97d9583f435652f1982319eea7f159fd

Contents?: true

Size: 1.64 KB

Versions: 14

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

14 entries across 14 versions & 6 rubygems

Version Path
fog-nirvanix-1.8.2 tests/hp/requests/cdn/container_tests.rb
fog-nirvanix-1.8.1 tests/hp/requests/cdn/container_tests.rb
fog-parser-fix-1.6.1 tests/hp/requests/cdn/container_tests.rb
fog-test-again-1.6.0 tests/hp/requests/cdn/container_tests.rb
fog-parser-fix-1.6.0 tests/hp/requests/cdn/container_tests.rb
fog-1.9.0 tests/hp/requests/cdn/container_tests.rb
fog-maestrodev-1.8.0.20130114204828 tests/hp/requests/cdn/container_tests.rb
fog-maestrodev-1.8.0.20130111070250 tests/hp/requests/cdn/container_tests.rb
fog-maestrodev-1.8.0.20130109172219 tests/hp/requests/cdn/container_tests.rb
fog-sgonyea-1.8.1 tests/hp/requests/cdn/container_tests.rb
fog-1.8.0 tests/hp/requests/cdn/container_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/hp/requests/cdn/container_tests.rb
fog-1.7.0 tests/hp/requests/cdn/container_tests.rb
fog-1.6.0 tests/hp/requests/cdn/container_tests.rb