Add a UUID to projects

This commit is contained in:
Veronica Berglyd Olsen
2022-11-05 17:03:45 +01:00
parent 8b4dac4e13
commit c6d3f680cc
22 changed files with 91 additions and 40 deletions
+19 -5
View File
@@ -30,11 +30,11 @@ from tools import writeFile
from novelwriter.guimain import GuiMain
from novelwriter.common import (
checkStringNone, checkString, checkInt, checkFloat, checkBool, checkHandle,
isHandle, isTitleTag, isItemClass, isItemType, isItemLayout, hexToInt,
minmax, checkIntTuple, formatInt, formatTimeStamp, formatTime, simplified,
splitVersionNumber, transferCase, fuzzyTime, numberToRoman, jsonEncode,
readTextFile, makeFileNameSafe, ensureFolder, sha256sum, getGuiItem,
NWConfigParser
checkUuid, isHandle, isTitleTag, isItemClass, isItemType, isItemLayout,
hexToInt, minmax, checkIntTuple, formatInt, formatTimeStamp, formatTime,
simplified, splitVersionNumber, transferCase, fuzzyTime, numberToRoman,
jsonEncode, readTextFile, makeFileNameSafe, ensureFolder, sha256sum,
getGuiItem, NWConfigParser
)
@@ -137,6 +137,20 @@ def testBaseCommon_CheckHandle():
# END Test testBaseCommon_CheckHandle
@pytest.mark.base
def testBaseCommon_CheckUuid():
"""Test the checkUuid function.
"""
testUuid = "e2be99af-f9bf-4403-857a-c3d1ac25abea"
assert checkUuid("", None) is None
assert checkUuid("e2be99af-f9bf-4403-857a-c3d1ac25abe", None) is None
assert checkUuid("e2be99af-f9bf-qq03-857a-c3d1ac25abea", None) is None
assert checkUuid("e2be99af-f9bf-4403-857a-c3d1ac25abeaa", None) is None
assert checkUuid(testUuid, None) == testUuid
# END Test testBaseCommon_CheckUuid
@pytest.mark.base
def testBaseCommon_IsHandle():
"""Test the isHandle function.