Esempio n. 1
0
def test_newick__get_leaf_nodes__complex_case():
    node_a = Newick(name = "Leaf A")
    node_b = Newick(name = "Leaf B")
    node_c = Newick(name = "Leaf C")
    sub_a  = Newick(children = [node_b, node_c])
    top_node = Newick(children = [node_a, sub_a])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b, node_c])
Esempio n. 2
0
def test_newick__get_leaf_nodes__complex_case():
    node_a = Newick(name="Leaf A")
    node_b = Newick(name="Leaf B")
    node_c = Newick(name="Leaf C")
    sub_a = Newick(children=[node_b, node_c])
    top_node = Newick(children=[node_a, sub_a])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b, node_c])
Esempio n. 3
0
def test_newick__get_leaf_nodes__internal_node_returns_leaf_nodes():
    node_a = Newick(name = "Leaf A")
    node_b = Newick(name = "Leaf B")
    top_node = Newick(children = [node_a, node_b])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b])
Esempio n. 4
0
def test_newick__get_leaf_nodes__leaf_returns_self():
    node = Newick(name = "Leaf")
    assert_list_equal(node.get_leaf_nodes(), [node])
Esempio n. 5
0
def test_newick__get_leaf_nodes__internal_node_returns_leaf_nodes():
    node_a = Newick(name="Leaf A")
    node_b = Newick(name="Leaf B")
    top_node = Newick(children=[node_a, node_b])
    assert_list_equal(top_node.get_leaf_nodes(), [node_a, node_b])
Esempio n. 6
0
def test_newick__get_leaf_nodes__leaf_returns_self():
    node = Newick(name="Leaf")
    assert_list_equal(node.get_leaf_nodes(), [node])