mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
added alarm_data_tests
This commit is contained in:
parent
a7b258b7ea
commit
bc638e569b
1 changed files with 40 additions and 0 deletions
40
tests/aws/models/cloud_watch/alarm_data_tests.rb
Normal file
40
tests/aws/models/cloud_watch/alarm_data_tests.rb
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
Shindo.tests("AWS::CloudWatch | alarm_data", ['aws', 'cloudwatch']) do
|
||||||
|
|
||||||
|
tests('success') do
|
||||||
|
tests("#all").succeeds do
|
||||||
|
Fog::AWS[:cloud_watch].alarm_data.all
|
||||||
|
end
|
||||||
|
|
||||||
|
alarm_name_prefix = {'AlarmNamePrefix'=>'tmp'}
|
||||||
|
tests("#all_by_prefix").succeeds do
|
||||||
|
Fog::AWS[:cloud_watch].alarm_data.all(alarm_name_prefix)
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace = 'AWS/EC2'
|
||||||
|
metric_name = 'CPUUtilization'
|
||||||
|
|
||||||
|
tests("#get").succeeds do
|
||||||
|
Fog::AWS[:cloud_watch].alarm_data.get(namespace, metric_name).to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
new_attributes = {
|
||||||
|
:alarm_name => 'tmp-alarm',
|
||||||
|
:comparison_operator => 'GreaterThanOrEqualToThreshold',
|
||||||
|
:evaluation_periods => 1,
|
||||||
|
:metric_name => 'tmp-metric-alarm',
|
||||||
|
:namespace => 'fog-0.11.0',
|
||||||
|
:period => 60,
|
||||||
|
:statistic => 'Sum',
|
||||||
|
:threshold => 5
|
||||||
|
}
|
||||||
|
tests('#new').returns(new_attributes) do
|
||||||
|
Fog::AWS[:cloud_watch].alarm_data.new(new_attributes).attributes
|
||||||
|
end
|
||||||
|
|
||||||
|
tests('#create').returns(new_attributes) do
|
||||||
|
Fog::AWS[:cloud_watch].alarm_data.create(new_attributes).attributes
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue