Add coverage to remaining missed lines

This commit is contained in:
Veronica Berglyd Olsen
2024-11-25 00:07:32 +01:00
parent e30d2cbbf1
commit 4cadd1597e
8 changed files with 199 additions and 44 deletions
+1 -17
View File
@@ -225,12 +225,7 @@ class GuiItemDetails(QWidget):
def updateViewBox(self, tHandle: str | None) -> None:
"""Populate the details box from a given handle."""
if tHandle is None:
self.clearDetails()
return
nwItem = SHARED.project.tree[tHandle]
if nwItem is None:
if not (tHandle and (nwItem := SHARED.project.tree[tHandle])):
self.clearDetails()
return
@@ -297,14 +292,3 @@ class GuiItemDetails(QWidget):
elif change == nwChange.DELETE:
self.updateViewBox(None)
return
@pyqtSlot(str, int, int, int)
def updateCounts(self, tHandle: str, cC: int, wC: int, pC: int) -> None:
"""Update the counts if the handle is the same as the one we're
already showing. Otherwise, do nothing.
"""
if tHandle == self._handle:
self.cCountData.setText(f"{cC:n}")
self.wCountData.setText(f"{wC:n}")
self.pCountData.setText(f"{pC:n}")
return