mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[tests] rearrange to match new lib structure
This commit is contained in:
parent
3a17ba2249
commit
fcc5a1c224
100 changed files with 0 additions and 49 deletions
|
@ -1,49 +0,0 @@
|
|||
require 'fog/aws/parsers/compute/monitor_unmonitor_instances'
|
||||
|
||||
Shindo.tests('Compute::AWS::MonitorUnmonitorInstances | monitor/unmonitor parser') do
|
||||
|
||||
tests('success') do
|
||||
|
||||
tests('#parse') do
|
||||
|
||||
aws_result = <<-AWS
|
||||
<UnmonitorInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/">
|
||||
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
|
||||
<instancesSet>
|
||||
<item>
|
||||
<instanceId>i-43a4412a</instanceId>
|
||||
<monitoring>
|
||||
<state>enabled</state>
|
||||
</monitoring>
|
||||
</item>
|
||||
<item>
|
||||
<instanceId>i-23a3397d</instanceId>
|
||||
<monitoring>
|
||||
<state>disabled</state>
|
||||
</monitoring>
|
||||
</item>
|
||||
</instancesSet>
|
||||
</UnmonitorInstancesResponse>
|
||||
AWS
|
||||
|
||||
parser = Fog::Parsers::Compute::AWS::MonitorUnmonitorInstances.new
|
||||
body = Nokogiri::XML::SAX::PushParser.new(parser)
|
||||
body << aws_result
|
||||
|
||||
test('requestId') { parser.response['requestId'] == '59dbff89-35bd-4eac-99ed-be587EXAMPLE' }
|
||||
|
||||
test('enabled') do
|
||||
selected = parser.response['instancesSet'].select { |item| item['instanceId'] == 'i-43a4412a' }[0]
|
||||
selected['monitoring'] == 'enabled'
|
||||
end
|
||||
|
||||
test('disabled') do
|
||||
selected = parser.response['instancesSet'].select { |item| item['instanceId'] == 'i-23a3397d' }[0]
|
||||
selected['monitoring'] == 'disabled'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue