mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Added alarm list and alarm get tests
This commit is contained in:
parent
ff1a04eaab
commit
6b5662fd05
1 changed files with 16 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
Shindo.tests('Fog::Rackspace::Monitoring | check_alarms', ['rackspace','rackspacemonitoring']) do
|
Shindo.tests('Fog::Rackspace::Monitoring | alarm_tests', ['rackspace']) do
|
||||||
pending if Fog.mocking?
|
pending if Fog.mocking?
|
||||||
|
|
||||||
account = Fog::Rackspace::Monitoring.new
|
account = Fog::Rackspace::Monitoring.new
|
||||||
|
@ -26,22 +26,34 @@ Shindo.tests('Fog::Rackspace::Monitoring | check_alarms', ['rackspace','rackspac
|
||||||
options = { :label => "Bar"}
|
options = { :label => "Bar"}
|
||||||
account.update_alarm(entity_id,alarm_id,options).data
|
account.update_alarm(entity_id,alarm_id,options).data
|
||||||
end
|
end
|
||||||
|
tests('#list alarms').formats(LIST_HEADERS_FORMAT) do
|
||||||
|
account.list_alarms(entity_id).data[:headers]
|
||||||
|
end
|
||||||
|
tests('#get alarm').formats(LIST_HEADERS_FORMAT) do
|
||||||
|
account.get_alarm(entity_id,alarm_id).data[:headers]
|
||||||
|
end
|
||||||
# delete is not currently supported in fog
|
# delete is not currently supported in fog
|
||||||
#tests('#delete alarm').formats(DELETE_DATA_FORMAT) do
|
#tests('#delete alarm').formats(DELETE_DATA_FORMAT) do
|
||||||
#account.delete_alarm(entity_id,check_id).data
|
#account.delete_alarm(entity_id,check_id).data
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
tests('failure') do
|
tests('failure') do
|
||||||
tests('#create new alarm(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
|
tests('#fail to create new alarm(-1)').raises(Fog::Rackspace::Monitoring::BadRequest) do
|
||||||
account.create_alarm(entity_id, {:type => ""})
|
account.create_alarm(entity_id, {:type => ""})
|
||||||
end
|
end
|
||||||
# Commenting out update because incorrect update throws a 502
|
# Commenting out update because incorrect update throws a 502
|
||||||
#tests('#update invalid alarm(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
|
#tests('#fail to update invalid alarm(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
|
||||||
#options = { :testing => "Bar" }
|
#options = { :testing => "Bar" }
|
||||||
#response = account.update_alarm(-1,-1,options)
|
#response = account.update_alarm(-1,-1,options)
|
||||||
#end
|
#end
|
||||||
|
tests('#fail to list alarms').raises(Fog::Rackspace::Monitoring::NotFound) do
|
||||||
|
account.list_alarms(-1)
|
||||||
|
end
|
||||||
|
tests('#fail to get alarm').raises(Fog::Rackspace::Monitoring::NotFound) do
|
||||||
|
account.get_alarm(-1,-1)
|
||||||
|
end
|
||||||
# delete is not currently supported in fog
|
# delete is not currently supported in fog
|
||||||
#tests('#delete alarm(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
|
#tests('#fail to delete alarm(-1)').raises(Fog::Rackspace::Monitoring::NotFound) do
|
||||||
#account.delete_alarm(-1,-1)
|
#account.delete_alarm(-1,-1)
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue