def border_collapse_tree(): box = Box( title="Root", children=( Box( title="A", children=( Box(title="AA", ), Box(title="AB", ), ), ), Box(title="B", ), ), ) box.available_height = 100 box.available_width = 100 return box
def tree(): box = Box( title="Root", style=Style(border_collapse=False), children=( Box( title="A", style=Style(border_collapse=False), children=( Box(title="AA", ), Box(title="AB", ), ), ), Box(title="B", ), ), ) box.available_height = 100 box.available_width = 100 return box
def test_add_children(tree): box1 = Box() box2 = Box() tree.add_children(box1, box2) assert box1.parent == tree assert box2.parent == tree
def test_add_child(tree): box = Box() tree.add_child(box) assert box.parent == tree