Sha256: c0e3c98330cf299b1d68e9d23ff3c85020c93ea5b103f5a80bc316c72bdcfbc5

Contents?: true

Size: 1.42 KB

Versions: 83

Compression:

Stored size: 1.42 KB

Contents

Shindo.tests('Fog::Metering[:openstack] | meter requests', ['openstack']) do

  @sample_format = {
    'counter_name'      => String,
    'user_id'           => String,
    'resource_id'       => String,
    'timestamp'         => String,
    'resource_metadata' => Hash,
    'source'            => String,
    'counter_unit'      => String,
    'counter_volume'    => Float,
    'project_id'        => String,
    'message_id'        => String,
    'counter_type'      => String
  }

  @meter_format = {
    'user_id'     => String,
    'name'        => String,
    'resource_id' => String,
    'project_id'  => String,
    'type'        => String,
    'unit'        => String
  }

  @statistics_format = {
    'count'          => Integer,
    'duration_start' => String,
    'min'            => Float,
    'max'            => Float,
    'duration_end'   => String,
    'period'         => Integer,
    'period_end'     => String,
    'duration'       => Float,
    'period_start'   => String,
    'avg'            => Float,
    'sum'            => Float
  }
  tests('success') do
    tests('#list_meters').formats([@meter_format]) do
      Fog::Metering[:openstack].list_meters.body
    end

    tests('#get_samples').formats([@sample_format]) do
      Fog::Metering[:openstack].get_samples('test').body
    end

    tests('#get_statistics').formats([@statistics_format]) do
      Fog::Metering[:openstack].get_statistics('test').body
    end
  end
end

Version data entries

83 entries across 83 versions & 7 rubygems

Version Path
fog-openstack-0.1.7 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.6 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.5 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.4 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.3 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.2 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.1 tests/openstack/requests/metering/meter_tests.rb
fog-openstack-0.1.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.37.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.36.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.35.0 tests/openstack/requests/metering/meter_tests.rb
fog-2.0.0.pre.0 tests/openstack/requests/metering/meter_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/openstack/requests/metering/meter_tests.rb
fog-1.34.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.33.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.32.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.31.0 tests/openstack/requests/metering/meter_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/openstack/requests/metering/meter_tests.rb
fog-1.30.0 tests/openstack/requests/metering/meter_tests.rb
fog-1.29.0 tests/openstack/requests/metering/meter_tests.rb