Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_clone():
"""
This test illustrates how a tree can be assembled programmatically.
"""
newick = '(A,B,(C,D)E)F'
tree1 = parse_node(newick)
def clone_node(n):
c = Node(name=n.name)
for nn in n.descendants:
c.add_descendant(clone_node(nn))
return c
assert clone_node(tree1).newick == newick