def testAppendChildDocument(self): doc1 = Document() n1 = Element(doc1, "foo") doc2 = Document() self.assertFalse(doc1.canAppendChild(doc2)) self.assertFalse(n1.canAppendChild(doc1)) self.assertFalse(n1.canAppendChild(doc2))
def testAppendChildDocument(self): element = Element("foo") document = Document() self.assertFalse(element.canAppendChild(document)) self.assertIsNone(element.appendChild(document))
def testAppendChild(self): node1 = Element("foo") node2 = Element("bar") self.assertTrue(node1.canAppendChild(node2)) self.assertEqual(node1.appendChild(node2), node2)