Skip to content

Commit 70e0163

Browse files
committed
test empty tree
1 parent f82c669 commit 70e0163

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/compas/datastructures/test_tree.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ def test_tree_initialization():
5151
assert tree.root is None
5252

5353

54+
def test_empty_tree():
55+
tree = Tree()
56+
assert tree.root is None
57+
assert len(list(tree.nodes)) == 0
58+
assert len(list(tree.leaves)) == 0
59+
assert list(tree.traverse()) == []
60+
assert tree.get_hierarchy_string() == ""
61+
62+
5463
# =============================================================================
5564
# TreeNode Properties
5665
# =============================================================================

0 commit comments

Comments
 (0)