Sha256: 48d0534a14f81c9d2aa3c4e5117cb8e07e0c5831deab5643a05300b08c160d95

Contents?: true

Size: 1.38 KB

Versions: 103

Compression:

Stored size: 1.38 KB

Contents

Shindo.tests('AWS::CloudWatch | metric requests', ['aws', 'cloudwatch']) do
  tests('success') do

    namespace = 'Custom/Test'
    @puts_format = {'ResponseMetadata' => {'RequestId' => String}}

    tests('#puts_value').formats(@puts_format) do
      pending if Fog.mocking?
      Fog::AWS[:cloud_watch].put_metric_data(namespace, [{'MetricName' => 'RequestTest', 'Unit' => 'None', 'Value' => 1}]).body
    end

    tests('#puts_statistics_set').succeeds do
      pending if Fog.mocking?
      Fog::AWS[:cloud_watch].put_metric_data(namespace, [{'MetricName' => 'RequestTest', 'Unit' => 'None', 'StatisticValues' => {'Minimum' => 0, 'Maximum' => 9, 'Sum' => 45, 'SampleCount' => 10, 'Average' => 4.5}}]).body
    end

    tests('#puts with dimensions').succeeds do
      pending if Fog.mocking?
      dimensions = [{}]
      Fog::AWS[:cloud_watch].put_metric_data(namespace, [{'MetricName' => 'RequestTest', 'Unit' => 'None', 'Value' => 1, 'Dimensions' => dimensions}]).body
    end

    tests('#puts more than one').succeeds do
      pending if Fog.mocking?
      datapoints = (0...3).collect do |i|
        dp = {'MetricName' => "#{i}RequestTest", 'Unit' => 'None', 'Value' => i}
        if i%2==0
          dp['Dimensions'] = [{'Name' => 'Ruler', 'Value' => "measurement_#{i}"}]
        end
        dp
      end
      Fog::AWS[:cloud_watch].put_metric_data(namespace, datapoints).body
    end

  end
end

Version data entries

103 entries across 103 versions & 17 rubygems

Version Path
fog-1.10.1 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-parser-fix-1.6.1 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-test-again-1.6.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-test-me-1.10.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-parser-fix-1.6.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.10.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.9.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.8.0.20130114204828 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.8.0.20130111070250 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.8.0.20130109172219 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-sgonyea-1.8.1 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.8.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.7.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.6.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.5.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
rackspace-fog-1.4.2 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.4.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/tests/aws/requests/cloud_watch/put_metric_data_tests.rb
michiels-fog-1.3.1 tests/aws/requests/cloud_watch/put_metric_data_tests.rb