def testCloneXml(self): xml = xmppserver.ParseXml('<foo/>') xml_clone = xmppserver.CloneXml(xml) xml_clone.setAttribute('bar', 'baz') self.assertEqual(xml, xml) self.assertEqual(xml_clone, xml_clone) self.assertNotEqual(xml, xml_clone)
def testCloneXmlUnlink(self): xml_text = '<foo/>' xml = xmppserver.ParseXml(xml_text) xml_clone = xmppserver.CloneXml(xml) xml.unlink() self.assertEqual(xml.parentNode, None) self.assertNotEqual(xml_clone.parentNode, None) self.assertEqual(xml_clone.toxml(), xml_text)