def testDfsTree(self):
     cases = [(0, '<a Pre="0" Post="7"><b Pre="3" Post="6"><c Pre="4" Post="5"/></b><d Pre="1" Post="2"/></a>')]
     for cid,truevalue in cases:
         apple = etree.fromstring(self.xmllist[cid])
         BasicFeatureExtraction.dfsTree(apple, printPreorder, printPostorder)
         truetree = etree.fromstring(truevalue)
         appletree = apple.getroottree()
         for grape in apple.iter():
             xpath = appletree.getpath(grape)
             self.assertEqual(grape.attrib['Pre'], truetree.xpath(xpath)[0].attrib['Pre'], cid)
             self.assertEqual(grape.attrib['Post'], truetree.xpath(xpath)[0].attrib['Post'], cid)
         print(etree.tostring(apple))