Revision c6c217d4 src/oca/ruby/test/Host_spec.rb

View differences:

src/oca/ruby/test/Host_spec.rb
67 67
            @host['TEMPLATE/HYPERVISOR'].should eql('dummy')
68 68
            @host['TEMPLATE/TOTALMEMORY'].should eql('16777216')
69 69
        end
70

  
71
        it "should get a hash representation of the HOST" do
72
            host_hash = @host.to_hash
73
            host_hash['HOST']['ID'].should eql('7')
74
            host_hash['HOST']['NAME'].should eql('dummyhost')
75
            host_hash['HOST']['STATE'].should eql('2')
76
            host_hash['HOST']['IM_MAD'].should eql('im_dummy')
77
            host_hash['HOST']['LAST_MON_TIME'].should eql('1277733596')
78
            host_hash['HOST']['HOST_SHARE']['MEM_USAGE'].should eql('1572864')
79
            host_hash['HOST']['HOST_SHARE']['CPU_USAGE'].should eql('300')
80
            host_hash['HOST']['HOST_SHARE']['FREE_CPU'].should eql('800')
81
            host_hash['HOST']['HOST_SHARE']['RUNNING_VMS'].should eql('3')
82
            host_hash['HOST']['TEMPLATE']['CPUSPEED'].should eql('2.2GHz')
83
            host_hash['HOST']['TEMPLATE']['HYPERVISOR'].should eql('dummy')
84
            host_hash['HOST']['TEMPLATE']['TOTALMEMORY'].should eql('16777216')
85
        end
86 70
    end
87 71

  
88 72
    describe "Host using REXML" do
......
147 131
            @host['TEMPLATE/HYPERVISOR'].should eql('dummy')
148 132
            @host['TEMPLATE/TOTALMEMORY'].should eql('16777216')
149 133
        end
150

  
151
        it "should get a hash representation of the HOST" do
152
            host_hash = @host.to_hash
153
            host_hash['HOST']['ID'].should eql('7')
154
            host_hash['HOST']['NAME'].should eql('dummyhost')
155
            host_hash['HOST']['STATE'].should eql('2')
156
            host_hash['HOST']['IM_MAD'].should eql('im_dummy')
157
            host_hash['HOST']['LAST_MON_TIME'].should eql('1277733596')
158
            host_hash['HOST']['HOST_SHARE']['MEM_USAGE'].should eql('1572864')
159
            host_hash['HOST']['HOST_SHARE']['CPU_USAGE'].should eql('300')
160
            host_hash['HOST']['HOST_SHARE']['FREE_CPU'].should eql('800')
161
            host_hash['HOST']['HOST_SHARE']['RUNNING_VMS'].should eql('3')
162
            host_hash['HOST']['TEMPLATE']['CPUSPEED'].should eql('2.2GHz')
163
            host_hash['HOST']['TEMPLATE']['HYPERVISOR'].should eql('dummy')
164
            host_hash['HOST']['TEMPLATE']['TOTALMEMORY'].should eql('16777216')
165
        end
166 134
    end
167 135

  
168 136

  

Also available in: Unified diff