Sha256: 203e60dc854e7ae78649a410d1be71ed21fba189031ac64ebb6a6bad7903d3cc

Contents?: true

Size: 1.9 KB

Versions: 3

Compression:

Stored size: 1.9 KB

Contents

Shindo.tests('Brightbox::Compute | cloud ip requests', ['brightbox']) do

  tests('success') do

    tests("#create_cloud_ip()").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
      pending if Fog.mocking?
      data = Brightbox[:compute].create_cloud_ip()
      @cloud_ip_id = data["id"]
      data
    end

    tests("#list_cloud_ips()").formats(Brightbox::Compute::Formats::Collection::CLOUD_IPS) do
      pending if Fog.mocking?
      Brightbox[:compute].list_cloud_ips()
    end

    tests("#get_cloud_ip('#{@cloud_ip_id}')").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
      pending if Fog.mocking?
      Brightbox[:compute].get_cloud_ip(@cloud_ip_id)
    end

    unless Fog.mocking?
      server = Brightbox[:compute].servers.first
      interface_id = server.interfaces.first["id"]
      map_options = {:interface => interface_id}
    end

    tests("#map_cloud_ip('#{@cloud_ip_id}', #{map_options.inspect})").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
      pending if Fog.mocking?
      Brightbox[:compute].map_cloud_ip(@cloud_ip_id, map_options)
    end

    unless Fog.mocking?
      Brightbox[:compute].cloud_ips.get(@cloud_ip_id).wait_for { mapped? }
    end

    tests("#unmap_cloud_ip('#{@cloud_ip_id}')").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
      pending if Fog.mocking?
      Brightbox[:compute].unmap_cloud_ip(@cloud_ip_id)
    end

    tests("#destroy_cloud_ip('#{@cloud_ip_id}')").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
      pending if Fog.mocking?
      Brightbox[:compute].destroy_cloud_ip(@cloud_ip_id)
    end

  end

  tests('failure') do

    tests("#get_cloud_ip('cip-00000')").raises(Excon::Errors::NotFound) do
      pending if Fog.mocking?
      Brightbox[:compute].get_cloud_ip('cip-00000')
    end

    tests("#get_cloud_ip").raises(ArgumentError) do
      pending if Fog.mocking?
      Brightbox[:compute].get_cloud_ip
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-0.3.34 tests/brightbox/requests/compute/cloud_ip_tests.rb
fog-0.3.33 tests/brightbox/requests/compute/cloud_ip_tests.rb
fog-0.3.32 tests/brightbox/requests/compute/cloud_ip_tests.rb