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.22.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.21.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.20.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-1.19.0 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/aws/requests/cloud_watch/put_metric_data_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/aws/requests/cloud_watch/put_metric_data_tests.rb