Sha256: ead7be7cf14f3dfe733483ec921afc671b9f2f43ea3d5175c3adbe136a7f86ef

Contents?: true

Size: 1.85 KB

Versions: 10

Compression:

Stored size: 1.85 KB

Contents

Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do

  @spot_instance_requests_format = {
    'spotInstanceRequestSet' => [{
      'createTime'                => Time,
      'instanceId'                => Fog::Nullable::String,
      'launchedAvailabilityZone'  => Fog::Nullable::String,
      'launchSpecification'       => {
        'blockDeviceMapping'  => [],
        'groupSet'            => [String],
        'keyName'             => Fog::Nullable::String,
        'imageId'             => String,
        'instanceType'        => String,
        'monitoring'          => Fog::Boolean,
        'subnetId'            => String
      },
      'productDescription'        => String,
      'spotInstanceRequestId'     => String,
      'spotPrice'                 => Float,
      'state'                     => String,
      'type'                      => String
    }],
    'requestId' => String
  }

  @cancel_spot_instance_request_format = {
    'spotInstanceRequestSet' => [{
      'spotInstanceRequestId' => String,
      'state'                 => String
    }],
    'requestId' => String
  }

  tests('success') do

    pending if Fog.mocking?

    tests("#request_spot_instances('ami-3202f25b', 't1.micro', '0.001')").formats(@spot_instance_requests_format) do
      data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001').body
      @spot_instance_request_id = data['spotInstanceRequestSet'].first['spotInstanceRequestId']
      data
    end

    tests("#describe_spot_instance_requests").formats(@spot_instance_requests_format) do
      Fog::Compute[:aws].describe_spot_instance_requests.body
    end

    tests("#cancel_spot_instance_requests('#{@spot_instance_request_id}')").formats(@cancel_spot_instance_request_format) do
      Fog::Compute[:aws].cancel_spot_instance_requests(@spot_instance_request_id).body
    end

  end

end

Version data entries

10 entries across 10 versions & 6 rubygems

Version Path
fog-nirvanix-1.8.2 tests/aws/requests/compute/spot_instance_tests.rb
fog-nirvanix-1.8.1 tests/aws/requests/compute/spot_instance_tests.rb
fog-parser-fix-1.6.1 tests/aws/requests/compute/spot_instance_tests.rb
fog-test-again-1.6.0 tests/aws/requests/compute/spot_instance_tests.rb
fog-parser-fix-1.6.0 tests/aws/requests/compute/spot_instance_tests.rb
fog-sgonyea-1.8.1 tests/aws/requests/compute/spot_instance_tests.rb
fog-1.8.0 tests/aws/requests/compute/spot_instance_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/aws/requests/compute/spot_instance_tests.rb
fog-1.7.0 tests/aws/requests/compute/spot_instance_tests.rb
fog-1.6.0 tests/aws/requests/compute/spot_instance_tests.rb