Ejemplo n.º 1
0
def test_flatten(test_tree: Tree):
    assert test_tree.flatten() == test_tree.to_list_prefix()
Ejemplo n.º 2
0
def test_to_list_prefix(test_tree: Tree):
    assert [tree.name for tree in test_tree.to_list_prefix()] == [
        "root", "child1", "child1_child1", "child2", "child2_child1",
        "child2_child2", "child3", "child3_child1", "child3_child2",
        "child3_child3", "child3_child3_child1"
    ]