Remove encoding line and add spaces between classes and functions, tests

This commit is contained in:
Veronica Berglyd Olsen
2021-06-25 21:04:48 +02:00
parent edfd7c9770
commit 991a61f2f6
41 changed files with 150 additions and 41 deletions
+5 -1
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
novelWriter Test Suite Tools
==============================
@@ -25,6 +24,7 @@ import shutil
from PyQt5.QtWidgets import qApp
def cmpFiles(fileOne, fileTwo, ignoreLines=None):
"""Compare two files, but optionally ignore lines given by a list.
"""
@@ -70,6 +70,7 @@ def cmpFiles(fileOne, fileTwo, ignoreLines=None):
return not diffFound
def getGuiItem(theName):
"""Returns a QtWidget based on its objectName.
"""
@@ -78,18 +79,21 @@ def getGuiItem(theName):
return qWidget
return None
def readFile(fileName):
"""Returns the content of a file as a string.
"""
with open(fileName, mode="r", encoding="utf8") as inFile:
return inFile.read()
def writeFile(fileName, fileData):
"""Write the contents of a string to a file.
"""
with open(fileName, mode="w", encoding="utf8") as outFile:
outFile.write(fileData)
def cleanProject(projPath):
"""Delete all generated files in a project.
"""