Ejemplo n.º 1
0
 def test_is_symmetrical(self):
     unlabelled_leaf = RankTree(children=[])
     assert unlabelled_leaf.is_symmetrical()
     three_leaf_asym = RankTree(children=[
         unlabelled_leaf,
         RankTree(children=[unlabelled_leaf, unlabelled_leaf]),
     ])
     assert not three_leaf_asym.is_symmetrical()
     six_leaf_sym = RankTree(children=[three_leaf_asym, three_leaf_asym])
     assert six_leaf_sym.is_symmetrical()
Ejemplo n.º 2
0
 def test_is_symmetrical(self):
     unlabelled_leaf = RankTree(children=[])
     self.assertTrue(unlabelled_leaf.is_symmetrical())
     three_leaf_asym = RankTree(children=[
         unlabelled_leaf,
         RankTree(children=[unlabelled_leaf, unlabelled_leaf]),
     ])
     self.assertFalse(three_leaf_asym.is_symmetrical())
     six_leaf_sym = RankTree(children=[three_leaf_asym, three_leaf_asym])
     self.assertTrue(six_leaf_sym.is_symmetrical())