Esempio n. 1
0
 def test_toXML_loaded(self):
     """Properties creates XML for given values"""
     p = FaultState.Properties()
     p['Name1'] = 'Value1'
     p['Name2'] = 'Value2'
     self.assertEquals(
         '<user-properties>\n   <property name="Name2" value="Value2"/>\n   <property name="Name1" value="Value1"/>\n</user-properties>\n',
         p.toXML(0))
Esempio n. 2
0
 def test_object_partial_initialization(self):
     """FaultState initializes with only a few values"""
     fs = FaultState.FaultState("Family")
     self.assertEquals(True, fs.family is None)
     self.assertEquals(True, fs.member is None)
     self.assertEquals(True, fs.code is None)
     self.assertEquals(FaultState.Properties(), fs.userProperties)
     self.assertEquals(True, fs.userTimestamp is None)
     self.assertEquals(True, fs.descriptor is None)
     self.assertEquals(True, fs.activatedByBackup is None)
     self.assertEquals(True, fs.terminatedByBackup is None)
Esempio n. 3
0
 def test_object_initialization(self):
     """FaultState initializes with all required values"""
     fs = FaultState.FaultState("Family", "Member", 1)
     self.assertEquals(False, fs.family is None)
     self.assertEquals("Family", fs.family)
     self.assertEquals(False, fs.member is None)
     self.assertEquals("Member", fs.member)
     self.assertEquals(False, fs.code is None)
     self.assertEquals(1, fs.code)
     self.assertEquals(FaultState.Properties(), fs.userProperties)
     self.assertEquals(True, fs.userTimestamp is None)
     self.assertEquals(True, fs.descriptor is None)
     self.assertEquals(True, fs.activatedByBackup is None)
     self.assertEquals(True, fs.terminatedByBackup is None)
Esempio n. 4
0
 def test_toXML_default(self):
     """Properties creates XML for default values"""
     p = FaultState.Properties()
     self.assertEquals('', p.toXML())