Added a test for the Build Novel Project tool

This commit is contained in:
Veronica K. B. Olsen
2020-05-30 11:42:09 +02:00
parent 017797667c
commit 5861892b2d
9 changed files with 655 additions and 19 deletions
+22 -4
View File
@@ -8,7 +8,7 @@ from os import path, mkdir
@pytest.fixture(scope="session")
def nwTemp():
testDir = path.dirname(__file__)
tempDir = path.join(testDir,"temp")
tempDir = path.join(testDir, "temp")
if path.isdir(tempDir):
shutil.rmtree(tempDir)
if not path.isdir(tempDir):
@@ -17,20 +17,38 @@ def nwTemp():
@pytest.fixture(scope="session")
def nwTempProj(nwTemp):
projDir = path.join(nwTemp,"proj")
projDir = path.join(nwTemp, "proj")
if not path.isdir(projDir):
mkdir(projDir)
return projDir
@pytest.fixture(scope="session")
def nwTempGUI(nwTemp):
guiDir = path.join(nwTemp,"gui")
guiDir = path.join(nwTemp, "gui")
if not path.isdir(guiDir):
mkdir(guiDir)
return guiDir
@pytest.fixture(scope="session")
def nwTempBuild(nwTemp):
buildDir = path.join(nwTemp, "build")
if not path.isdir(buildDir):
mkdir(buildDir)
return buildDir
@pytest.fixture(scope="session")
def nwRef():
testDir = path.dirname(__file__)
refDir = path.join(testDir,"reference")
refDir = path.join(testDir, "reference")
return refDir
@pytest.fixture(scope="session")
def nwLipsum():
testDir = path.dirname(__file__)
tempDir = path.join(testDir, "temp")
lipsumStore = path.join(testDir, "lipsum")
lipsumDir = path.join(tempDir, "lipsum")
if path.isdir(lipsumDir):
shutil.rmtree(lipsumDir)
shutil.copytree(lipsumStore, lipsumDir)
return lipsumDir