mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #16 from irdan/Alarm-Example-Tests
[rackspace|monitoring] Adding alarm example(s) tests
This commit is contained in:
commit
1a1d24862c
2 changed files with 36 additions and 0 deletions
17
tests/rackspace/models/monitoring/alarm_example_tests.rb
Normal file
17
tests/rackspace/models/monitoring/alarm_example_tests.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
Shindo.tests('Fog::Rackspace::Monitoring | alarm_example', ['rackspace','rackspace_monitoring']) do
|
||||||
|
|
||||||
|
service = Fog::Rackspace::Monitoring.new
|
||||||
|
alarm_example_id = 'remote.http_body_match_1'
|
||||||
|
alarm = service.alarm_examples.get(alarm_example_id)
|
||||||
|
|
||||||
|
tests('#bound?') do
|
||||||
|
tests('should return false if not bound') do
|
||||||
|
returns(false) {alarm.bound?}
|
||||||
|
end
|
||||||
|
tests('should return true if bound') do
|
||||||
|
values = {'string' => '12345'}
|
||||||
|
alarm = service.alarm_examples.evaluate(alarm_example_id,values)
|
||||||
|
returns(true) {alarm.bound?}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
19
tests/rackspace/models/monitoring/alarm_examples_tests.rb
Normal file
19
tests/rackspace/models/monitoring/alarm_examples_tests.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
Shindo.tests('Fog::Rackspace::Monitoring | alarm_examples', ['rackspace','rackspace_monitoring']) do
|
||||||
|
pending if Fog.mocking? && !mocks_implemented
|
||||||
|
|
||||||
|
service = Fog::Rackspace::Monitoring.new
|
||||||
|
alarm_example_id = 'remote.http_body_match_1'
|
||||||
|
|
||||||
|
tests('success') do
|
||||||
|
tests('all').succeeds do
|
||||||
|
service.alarm_examples.all
|
||||||
|
end
|
||||||
|
tests('get').succeeds do
|
||||||
|
service.alarm_examples.get(alarm_example_id)
|
||||||
|
end
|
||||||
|
tests('evaluate').succeeds do
|
||||||
|
values = {'string'=> '12345'}
|
||||||
|
service.alarm_examples.evaluate(alarm_example_id,values)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue