コード例 #1
0
ファイル: test_hexes.py プロジェクト: pipermerriam/hexes
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
コード例 #2
0
ファイル: test_hexes.py プロジェクト: pipermerriam/hexes
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
コード例 #3
0
ファイル: test_hexes.py プロジェクト: pipermerriam/hexes
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
コード例 #4
0
ファイル: test_hexes.py プロジェクト: pipermerriam/hexes
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
コード例 #5
0
ファイル: test_hexes.py プロジェクト: pipermerriam/hexes
def test_add_children(tree):
    box1 = Box()
    box2 = Box()
    tree.add_children(box1, box2)
    assert box1.parent == tree
    assert box2.parent == tree
コード例 #6
0
ファイル: test_hexes.py プロジェクト: pipermerriam/hexes
def test_add_child(tree):
    box = Box()
    tree.add_child(box)
    assert box.parent == tree