Sha256: 1f59190c08d77a0b77ae97d5e0e48009b9cd95bb5d9395ae19fb78af76d80db6

Contents?: true

Size: 1.97 KB

Versions: 179

Compression:

Stored size: 1.97 KB

Contents

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

  tests('success') do
    @metrics_list_format = {
      'ListMetricsResult' => {
        'Metrics' =>
          [{
            'Dimensions' =>
            [{
              'Name' => String,
              'Value' => String
            }],
            "MetricName" => String,
            "Namespace" => String
          }],
        'NextToken' => Fog::Nullable::String,
      },
      'ResponseMetadata' => {"RequestId"=> String},
    }
    @instanceId = 'i-2f3eab59'
    @dimension_filtered_metrics_list_format = {
      'ListMetricsResult' => {
        'Metrics' =>
          [{
            'Dimensions' =>
            [{
              'Name' => 'InstanceId',
              'Value' => @instanceId
            }],
            "MetricName" => String,
            "Namespace" => String
          }],
        'NextToken' => Fog::Nullable::String,
      },
      'ResponseMetadata' => {"RequestId"=> String},
    }

    tests("#list_metrics").formats(@metrics_list_format) do
      pending if Fog.mocking?
      Fog::AWS[:cloud_watch].list_metrics.body
    end

    tests("#dimension_filtered_list_metrics").formats(@dimension_filtered_metrics_list_format) do
      pending if Fog.mocking?
      Fog::AWS[:cloud_watch].list_metrics('Dimensions' => [{'Name' => 'InstanceId', 'Value' => @instanceId}]).body
    end

    tests("#metric_name_filtered_list_metrics").returns(true) do
      pending if Fog.mocking?
      metricName = "CPUUtilization"
      Fog::AWS[:cloud_watch].list_metrics('MetricName' => metricName).body['ListMetricsResult']['Metrics'].all? do |metric|
        metric['MetricName'] == metricName
      end
    end

    tests("#namespace_filtered_list_metrics").returns(true) do
      pending if Fog.mocking?
      namespace = "AWS/EC2"
      Fog::AWS[:cloud_watch].list_metrics('Namespace' => namespace).body['ListMetricsResult']['Metrics'].all? do |metric|
        metric['Namespace'] == namespace
      end
    end
  end
end

Version data entries

179 entries across 177 versions & 22 rubygems

Version Path
fog-maestrodev-1.18.0.20131206115947 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131205181604 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131127194823 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131126183714 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131126122111 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131125111730 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131125083406 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131123105121 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131122203507 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131121075022 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131118164830 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131115184302 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131114200144 tests/aws/requests/cloud_watch/list_metrics_test.rb
gapinc-fog-1.12.1.2.1 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131112185232 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.18.0.20131111203459 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-1.18.0 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-1.17.0 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-1.16.0 tests/aws/requests/cloud_watch/list_metrics_test.rb
fog-maestrodev-1.15.0.20130927082724 tests/aws/requests/cloud_watch/list_metrics_test.rb