コード例 #1
0
 def testUnflattenTwoTrees(self):
   if IGNORE_TEST:
    return
   self.subparent.setIsAttached(False)
   elements = self.root.flatten()
   new_tree = NamedTree.unflatten(elements)
   self.assertTrue(self.root.isEquivalent(new_tree,
       is_exception=True))
コード例 #2
0
 def testUnflattenManyTrees(self):
   if IGNORE_TEST:
    return
   tree = NamedTree.createRandomNamedTree(100, 0.5,
       prob_detach=0.2)
   tree._checkTreeStructure()
   tree_list = tree.flatten()
   new_tree = NamedTree.unflatten(tree_list)
   self.assertTrue(tree.isEquivalent(new_tree))
コード例 #3
0
 def testUnflattenOneTree(self):
   if IGNORE_TEST:
     return
   tree_list = self.root.flatten()
   new_tree = NamedTree.unflatten(tree_list)
   self.assertTrue(self.root.isEquivalent(new_tree))