mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
10
tests/tree/test_tree_node_parent.py
Normal file
10
tests/tree/test_tree_node_parent.py
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
Reference in New Issue
Block a user