Beispiel #1
0
    def testRootElement(self):
        doc = Document()
        self.assertIsNone(doc.rootElement)

        n1 = Element(doc, "n1")
        self.assertEqual(doc.rootElement, n1)

        n2 = Element(n1, "n2")
        doc.rootElement = n2
        self.assertEqual(doc.rootElement, n2)
        self.assertFalse(n1.isAlive())
        self.assertTrue(n2.isAlive())
Beispiel #2
0
 def testRootElement(self):
     document = Document()
     document.rootElement = Vgc()
     self.assertEqual(document.rootElement.name, "vgc")