mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #19 from irdan/irdan/Check-Types-and-Alarms-Tests
[rackspace|monitoring] Addding Alarms and Check-Types tests
This commit is contained in:
commit
7cd354da8c
2 changed files with 37 additions and 0 deletions
24
tests/rackspace/models/monitoring/alarms_tests.rb
Normal file
24
tests/rackspace/models/monitoring/alarms_tests.rb
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Shindo.tests('Fog::Rackspace::Monitoring | alarms', ['rackspace','rackspace_monitoring']) do
|
||||||
|
service = Fog::Rackspace::Monitoring.new
|
||||||
|
|
||||||
|
begin
|
||||||
|
@entity = service.entities.create :label => "fog_#{Time.now.to_i.to_s}"
|
||||||
|
@check = service.checks.create(CHECK_CREATE_OPTIONS.merge(
|
||||||
|
:label => "fog_#{Time.now.to_i.to_s}",
|
||||||
|
:entity => @entity) )
|
||||||
|
np = "npTechnicalContactsEmail"
|
||||||
|
options = CHECK_CREATE_OPTIONS.merge(
|
||||||
|
:label => "fog_#{Time.now.to_i.to_s}",
|
||||||
|
:entity => @entity,
|
||||||
|
:entity_id => @entity.id,
|
||||||
|
:check => @check,
|
||||||
|
:check_id => @check.id,
|
||||||
|
:notification_plan_id => np
|
||||||
|
)
|
||||||
|
collection = service.alarms(:entity => @entity)
|
||||||
|
collection_tests(collection, options, false) do
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
@entity.destroy if @entity
|
||||||
|
end
|
||||||
|
end
|
13
tests/rackspace/models/monitoring/check_types_tests.rb
Normal file
13
tests/rackspace/models/monitoring/check_types_tests.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Shindo.tests('Fog::Rackspace::Monitoring | check_types', ['rackspace','rackspace_monitoring']) do
|
||||||
|
service = Fog::Rackspace::Monitoring.new
|
||||||
|
|
||||||
|
@check_types = service.check_types
|
||||||
|
|
||||||
|
tests('#all').succeeds do
|
||||||
|
@check_types.all
|
||||||
|
end
|
||||||
|
tests('#new').succeeds do
|
||||||
|
@check_types.new
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue