Sha256: ee948e1790e25034db7aa8699f341b540ef53d45a404d3c4f3fd0c2274ab39dc

Contents?: true

Size: 1.19 KB

Versions: 39

Compression:

Stored size: 1.19 KB

Contents

Shindo.tests('Fog::Compute::RackspaceV2 | key_pairs', ['rackspace']) do
  service = Fog::Compute::RackspaceV2.new

  name  = Fog::Mock.random_letters(32)
  key   = nil

  tests("API access") do
    begin
        tests("create").succeeds do
          key = service.key_pairs.create({:name => name})
        end

        tests("list all").succeeds do
          service.key_pairs.all
        end

        tests("get").succeeds do
          service.key_pairs.get(name)
        end

        tests("delete").succeeds do
          key = nil if service.key_pairs.destroy(name)
          key == nil
        end

        tests("get unknown").returns(nil) do
          service.key_pairs.get(Fog::Mock.random_letters(32))
        end

        tests("delete unknown").raises(Fog::Compute::RackspaceV2::NotFound) do
            service.key_pairs.destroy(Fog::Mock.random_letters(32))
        end

        tests("create again after delete").succeeds do
          key = service.key_pairs.create({:name => name})
        end

        tests("create already existing").raises(Fog::Compute::RackspaceV2::ServiceError) do
          service.key_pairs.create({:name => name})
        end

    ensure
        key.destroy if key
    end

  end
end

Version data entries

39 entries across 37 versions & 6 rubygems

Version Path
fog-rackspace-0.1.6 tests/rackspace/models/compute_v2/keypairs_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/compute_v2/keypairs_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/compute_v2/keypairs_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-rackspace-0.1.5 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-rackspace-0.1.4 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-rackspace-0.1.3 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-rackspace-0.1.2 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-rackspace-0.1.1 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-rackspace-0.1.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.37.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.36.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.35.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-2.0.0.pre.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.34.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.33.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.32.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
fog-1.31.0 tests/rackspace/models/compute_v2/keypairs_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/models/compute_v2/keypairs_tests.rb