1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-14 19:24:10 +03:00

Add to_hash test for REXML(cherry picked from commit 258090afeadb61575290d30b5999c9ea9ffed891)

This commit is contained in:
Daniel Molina 2011-02-15 11:20:49 +01:00
parent 2e8fd8e83a
commit 6f563ae73f

View File

@ -260,6 +260,23 @@ module OpenNebula
@vm['HISTORY/HOSTNAME'].should eql('dummyhost') @vm['HISTORY/HOSTNAME'].should eql('dummyhost')
@vm['HISTORY/PSTIME'].should eql('1277375186') @vm['HISTORY/PSTIME'].should eql('1277375186')
end end
it "should access an attribute using to_hash" do
vm_hash = @vm.to_hash
vm_hash['VM']['NAME'].should eql('vm-example')
vm_hash['VM']['DEPLOY_ID'].should eql('dummy')
vm_hash['VM']['TEMPLATE']['MEMORY'].should eql('512')
vm_hash['VM']['ID'].should eql('6')
vm_hash['VM']['NAME'].should eql('vm-example')
vm_hash['VM']['LCM_STATE'].should eql('3')
vm_hash['VM']['DEPLOY_ID'].should eql('dummy')
vm_hash['VM']['TEMPLATE']['MEMORY'].should eql('512')
vm_hash['VM']['TEMPLATE']['CONTEXT']['DNS'].should eql('192.169.1.4')
vm_hash['VM']['TEMPLATE']['DISK'][1]['SIZE'].should eql('1024')
vm_hash['VM']['HISTORY']['HOSTNAME'].should eql('dummyhost')
vm_hash['VM']['HISTORY']['PSTIME'].should eql('1277375186')
end
end end