Sha256: d97d92af64608e89ab1269479bff42818ca63b91c51207218957c3b6ae260f70

Contents?: true

Size: 1.21 KB

Versions: 27

Compression:

Stored size: 1.21 KB

Contents

# coding: utf-8
Shindo.tests('Fog::Network[:sakuracloud] | list_switches request', ['sakuracloud', 'network']) do

  @switches_format = {
    'Index'          => Integer,
    'ID'             => String,
    'Name'           => String,
    'ServerCount'    => Integer,
    'ApplianceCount' => Integer,
    'Subnets'        => Array
  }

  tests('success') do

    tests('#list_switches') do
      switches = sakuracloud_network_service.list_switches
      test 'returns a Hash' do
        switches.body.is_a? Hash
      end
      if Fog.mock?
        tests('Switches').formats(@switches_format, false) do
          switches.body['Switches'].first
        end
      else
        returns(200) { switches.status }
        returns(true) { switches.body.is_a? Hash }
      end
    end
  end
end

Shindo.tests('Fog::Network[:sakuracloud] | create_switch request', ['sakuracloud', 'network']) do
  tests('success') do
    tests('#create_simple_switch') do
      switch = sakuracloud_network_service.create_switch(:name => 'foobar')
      test 'returns a Hash' do
        switch.body.is_a? Hash
      end

      unless Fog.mock?
        returns(201) { switch.status }
        returns(true) { switch.body.is_a? Hash }
      end
    end
  end
end

Version data entries

27 entries across 25 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/network/switches_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/network/switches_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.7.5 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.7.4 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.7.3 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.7.2 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.7.1 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.7.0 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.6.0 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.5.2 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.5.1 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.5.0 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.4.0 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.3.3 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.3.2 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.3.1 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.3.0 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.2.0 tests/sakuracloud/requests/network/switches_tests.rb
fog-sakuracloud-1.1.1 tests/sakuracloud/requests/network/switches_tests.rb