Sha256: e126c7029660ea617cf5df9eeef4142dd5c931f26dfe031579b19ed31bdb8ccb

Contents?: true

Size: 1.15 KB

Versions: 26

Compression:

Stored size: 1.15 KB

Contents

Shindo.tests('Fog::Rackspace::Networking | network_tests', ['rackspace']) do
  service = Fog::Rackspace::Networking.new

  network_format = {
    'id' => String,
    'label' => String,
    'cidr' => Fog::Nullable::String
  }

  get_network_format = {
    'network' => network_format
  }

  list_networks_format = {
    'networks' => [network_format]
  }

  tests('success') do
    network_id = nil

    tests('#create_network').formats(get_network_format) do
      service.create_network("fog_#{Time.now.to_i.to_s}", '192.168.0.0/24').body.tap do |r|
        network_id = r['network']['id']
      end
    end

    tests('#list_networks').formats(list_networks_format) do
      service.list_networks.body
    end

    tests('#get_network').formats(get_network_format) do
      service.get_network(network_id).body
    end

    tests('#delete_network').succeeds do
      service.delete_network(network_id)
    end
  end

  test('failure') do
    tests('#get_network').raises(Fog::Rackspace::Networking::NotFound) do
      service.get_network(0)
    end

    tests('#delete_network').raises(Fog::Rackspace::Networking::NotFound) do
      service.delete_network(0)
    end
  end
end

Version data entries

26 entries across 24 versions & 5 rubygems

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