Add full test coverage

This commit is contained in:
Veronica Berglyd Olsen
2024-06-16 00:49:24 +02:00
parent 35632abea3
commit fe27acc3ef
2 changed files with 59 additions and 4 deletions
+2 -3
View File
@@ -353,7 +353,6 @@ class Config:
path = path.parent
if path.is_dir():
self._recentPaths.setPath(key, path)
self._recentPaths.saveCache()
return
def setBackupPath(self, path: Path | str) -> None:
@@ -907,6 +906,8 @@ class RecentPaths:
"""Set a path for a given key."""
if key in self.KEYS:
self._data[key] = str(path)
self.saveCache()
return
def getPath(self, key: str) -> str | None:
"""Get a path for a given key, or return None."""
@@ -928,7 +929,6 @@ class RecentPaths:
logger.error("Could not load recent paths cache")
logException()
return False
return True
def saveCache(self) -> bool:
@@ -943,5 +943,4 @@ class RecentPaths:
logger.error("Could not save recent paths cache")
logException()
return False
return True