File: spot_datafeed_subscription_tests.rb

package info (click to toggle)
ruby-fog-aws 3.33.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,180 kB
  • sloc: ruby: 75,405; javascript: 14; makefile: 9; sh: 4
file content (47 lines) | stat: -rw-r--r-- 1,753 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Shindo.tests('Fog::Compute[:aws] | spot datafeed subscription requests', ['aws']) do
  @spot_datafeed_subscription_format = {
    'spotDatafeedSubscription' => {
      'bucket'  => String,
      'ownerId' => String,
      'prefix'  => String,
      'state'   => String
    },
    'requestId' => String
  }

  @directory = Fog::Storage[:aws].directories.create(:key => 'fogspotdatafeedsubscriptiontests')

  tests('success') do
    pending if Fog.mocking?

    tests("#create_spot_datafeed_subscription('fogspotdatafeedsubscriptiontests', 'fogspotdatafeedsubscription/')").formats(@spot_datafeed_subscription_format) do
      Fog::Compute[:aws].create_spot_datafeed_subscription('fogspotdatafeedsubscriptiontests', 'fogspotdatafeedsubscription/').body
    end

    tests("duplicate #create_spot_datafeed_subscription('fogspotdatafeedsubscriptiontests', 'fogspotdatafeedsubscription/')").succeeds do
      Fog::Compute[:aws].create_spot_datafeed_subscription('fogspotdatafeedsubscriptiontests', 'fogspotdatafeedsubscription/')
    end

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

    tests("#delete_spot_datafeed_subscription").formats(AWS::Compute::Formats::BASIC) do
      Fog::Compute[:aws].delete_spot_datafeed_subscription.body
    end

    tests("duplicate #delete_spot_datafeed_subscription").succeeds do
      Fog::Compute[:aws].delete_spot_datafeed_subscription
    end
  end

  tests('failure') do
    pending if Fog.mocking?

    tests("#describe_spot_datafeed_subscription").raises(Fog::AWS::Compute::NotFound) do
      Fog::Compute[:aws].describe_spot_datafeed_subscription
    end
  end

  @directory.destroy
end