Esempio n. 1
0
 def testXML(self):
     '''Test XML serialization and re-composition from XML.
     '''
     a = ProfileAttributes('1.3.1.9', '2.0.0', 'profile', 'inactive', 'classified', '1.3.1', ['1.3.1.9.1', '1.3.1.9.2'],
         'NASA', ['Updated', 'Created'])
     doc = xml.dom.minidom.getDOMImplementation().createDocument(None, None, None)
     node = a.toXML(doc)
     b = ProfileAttributes(node=node)
     self.assertEquals(a, b)
Esempio n. 2
0
 def testXMLValidity(self):
     '''Test to see if all required XML elements are in there.
     '''
     a = ProfileAttributes('1.3.1.9', '2.0.0', 'profile', 'inactive', 'classified', '1.3.1', ['1.3.1.9.1', '1.3.1.9.2'],
         'NASA', ['Updated', 'Created'])
     doc = xml.dom.minidom.getDOMImplementation().createDocument(None, None, None)
     node = a.toXML(doc)
     self.assertEquals('profAttributes', node.nodeName)
     childElements = [n.nodeName for n in node.childNodes]
     self.assertEquals([u'profId', u'profVersion', u'profType', u'profStatusId', u'profSecurityType', u'profParentId',
         u'profChildId', u'profChildId', u'profRegAuthority', u'profRevisionNote', u'profRevisionNote'],
         childElements)