mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
11 lines
355 B
Python
11 lines
355 B
Python
from textual.widgets import TreeNode, Tree
|
|
|
|
def test_tree_node_parent() -> None:
|
|
"""It should be possible to access a TreeNode's parent."""
|
|
tree = Tree[None]("Anakin")
|
|
child = tree.root.add("Leia")
|
|
grandchild = child.add("Ben")
|
|
assert tree.root.parent is None
|
|
assert grandchild.parent == child
|
|
assert child.parent == tree.root
|