Update tests other than tree-related

This commit is contained in:
Veronica Berglyd Olsen
2024-11-23 19:30:29 +01:00
parent ca8bd8d271
commit 1bf42ceb55
29 changed files with 229 additions and 205 deletions
+6 -1
View File
@@ -91,6 +91,10 @@ class ProjectNode:
f"children={len(self._children)}>"
)
def __bool__(self) -> bool:
"""A node should always evaluate to True."""
return True
##
# Properties
##
@@ -190,10 +194,10 @@ class ProjectNode:
self._updateRelationships(child)
if 0 <= pos < len(self._children):
self._children.insert(pos, child)
self._refreshChildrenPos()
else:
child._row = len(self._children)
self._children.append(child)
self._refreshChildrenPos()
return
def takeChild(self, pos: int) -> ProjectNode | None:
@@ -229,6 +233,7 @@ class ProjectNode:
"""Update the row value on all children."""
for n, child in enumerate(self._children):
child._row = n
child.item.setOrder(n)
return
def _updateRelationships(self, child: ProjectNode) -> None: