Fix footnote formatting for ODT and update document builder tests

This commit is contained in:
Veronica Berglyd Olsen
2024-04-27 19:05:13 +02:00
parent db9305c230
commit e9596e1bbc
6 changed files with 278 additions and 75 deletions
+29 -10
View File
@@ -21,24 +21,25 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations
import time
import pytest
from pathlib import Path
from xml.etree import ElementTree as ET
from tools import writeFile
from mocked import causeOSError
import pytest
from PyQt5.QtGui import QColor, QDesktopServices
from mocked import causeOSError
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QColor, QDesktopServices
from tools import writeFile
from novelwriter.common import (
checkBool, checkFloat, checkInt, checkIntTuple, checkPath, checkString,
checkStringNone, checkUuid, cssCol, formatFileFilter, formatInt,
formatTime, formatTimeStamp, formatVersion, fuzzyTime, getFileSize,
hexToInt, isHandle, isItemClass, isItemLayout, isItemType, isTitleTag,
jsonEncode, makeFileNameSafe, minmax, numberToRoman, NWConfigParser,
openExternalPath, readTextFile, simplified, transferCase, xmlIndent, yesNo
NWConfigParser, checkBool, checkFloat, checkInt, checkIntTuple, checkPath,
checkString, checkStringNone, checkUuid, cssCol, formatFileFilter,
formatInt, formatTime, formatTimeStamp, formatVersion, fuzzyTime,
getFileSize, hexToInt, isHandle, isItemClass, isItemLayout, isItemType,
isListInstance, isTitleTag, jsonEncode, makeFileNameSafe, minmax,
numberToRoman, openExternalPath, readTextFile, simplified, transferCase,
xmlIndent, yesNo
)
@@ -272,6 +273,24 @@ def testBaseCommon_isItemLayout():
# END Test testBaseCommon_isItemLayout
@pytest.mark.base
def testBaseCommon_isListInstance():
"""Test the isListInstance function."""
# String
assert isListInstance("stuff", str) is False
assert isListInstance(["stuff"], str) is True
# Int
assert isListInstance(1, int) is False
assert isListInstance([1], int) is True
# Mixed
assert isListInstance([1], str) is False
assert isListInstance(["stuff"], int) is False
# END Test testBaseCommon_isListInstance
@pytest.mark.base
def testBaseCommon_hexToInt():
"""Test the hexToInt function."""