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
ns-fog-1.22.10 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.9 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.8 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.7 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.6 tests/hp/requests/network/network_tests.rb
fog-1.23.0 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.4 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.3 tests/hp/requests/network/network_tests.rb
ns-fog-1.22.2 tests/hp/requests/network/network_tests.rb
fog-1.22.1 tests/hp/requests/network/network_tests.rb