Sha256: 03d58846b65753a011d776862c81ff133fcb3848a88a34ea1981a0704b17c684

Contents?: true

Size: 1.7 KB

Versions: 30

Compression:

Stored size: 1.7 KB

Contents

Shindo.tests('HP::Network | networking network requests', ['hp',  'networking', 'network']) do

  @network_format = {
    'id'              => String,
    'name'            => Fog::Nullable::String,
    'tenant_id'       => String,
    'status'          => String,
    'subnets'         => Array,
    'router:external' => Fog::Boolean,
    'admin_state_up'  => Fog::Boolean,
    'shared'          => Fog::Boolean
  }

  tests('success') do

    @network_id = nil

    tests('#create_network').formats(@network_format) do
      attributes = {:name => 'my_network', :admin_state_up => true, :shared => false}
      data = HP[:network].create_network(attributes).body['network']
      @network_id = data['id']
      data
    end

    tests('#list_networks').formats({'networks' => [@network_format]}) do
      HP[:network].list_networks.body
    end

    tests("#get_network(#{@network_id})").formats({'network' => @network_format}) do
      HP[:network].get_network(@network_id).body
    end

    tests("#update_network(#{@network_id})").formats({'network' => @network_format}) do
      attributes = {:name => 'my_network_upd', :shared => false, :admin_state_up => true}
      HP[:network].update_network(@network_id, attributes).body
    end

    tests("#delete_network(#{@network_id})").succeeds do
      HP[:network].delete_network(@network_id)
    end
  end

  tests('failure') do
    tests('#get_network(0)').raises(Fog::HP::Network::NotFound) do
      HP[:network].get_network(0)
    end

    tests('#update_network(0)').raises(Fog::HP::Network::NotFound) do
      HP[:network].update_network(0, {})
    end

    tests('#delete_network(0)').raises(Fog::HP::Network::NotFound) do
      HP[:network].delete_network(0)
    end
  end

end

Version data entries

30 entries across 30 versions & 4 rubygems

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