Complete coverage of new project function and remove test code from main app

This commit is contained in:
Veronica K. B. Olsen
2020-09-29 21:49:00 +02:00
parent 0c9849b906
commit 0b7cd71b92
6 changed files with 275 additions and 23 deletions
+1 -1
View File
@@ -938,7 +938,7 @@ class NWProject():
return False
if path.isdir(projPath):
if self.mainConf.showGUI and listdir(self.projPath):
if listdir(self.projPath):
self.theParent.makeAlert((
"New project folder is not empty. "
"Each project requires a dedicated project folder."
+2 -2
View File
@@ -246,7 +246,7 @@ class GuiMain(QMainWindow):
# Project Actions
##
def newProject(self, projData=None, forceNew=False):
def newProject(self, projData=None):
"""Create new project with a few default files and folders.
The variable forceNew is used for testing.
"""
@@ -268,7 +268,7 @@ class GuiMain(QMainWindow):
logger.error("No projData or projPath set")
return False
if path.isfile(path.join(projPath, self.theProject.projFile)) and not forceNew:
if path.isfile(path.join(projPath, self.theProject.projFile)):
self.makeAlert(
"A project already exists in that location. Please choose another folder.",
nwAlert.ERROR