Ejemplo n.º 1
0
 def test_load_from_msg(self):
     
     for msg in self.cases.keys():
     
         cr = CloudSummaryRecord()
         cr.load_from_msg(msg)
         
         cont = cr._record_content
     
         for key in self.cases[msg].keys():
             self.assertEqual(cont[key], self.cases[msg][key], "%s != %s for key %s" % (cont[key], self.cases[msg][key], key))
Ejemplo n.º 2
0
 def test_mandatory_fields(self):
     record = CloudSummaryRecord()
     record.set_field('SiteName', 'MySite')
     record.set_field('Month', 1)
     record.set_field('Year', 2012)
     record.set_field('GlobalUserName', 'me')
     record.set_field('VO', 'myVO')
     record.set_field('VOGroup', 'myVOGroup')
     record.set_field('VORole', 'myVORole')
     record.set_field('Status', 'completed')
     record.set_field('CloudType', 'OpenStack')
     record.set_field('ImageId', 'img-01')
     record.set_field('NumberOfVMs', 1)
     
     try:
         record._check_fields()
     except Exception, e:
         self.fail('_check_fields method failed: %s [%s]' % (str(e), str(type(e))))