Minor improvements to existing tests to increase coverage

This commit is contained in:
Veronica K. B. Olsen
2020-09-19 18:51:45 +02:00
parent 149fc1a9c5
commit 4338580d2c
5 changed files with 95 additions and 8 deletions
+9 -1
View File
@@ -2,10 +2,12 @@
"""novelWriter Common Class Tester
"""
import time
import pytest
from nw.common import (
checkString, checkBool, checkInt, colRange, formatInt, transferCase,
fuzzyTime, checkHandle
fuzzyTime, checkHandle, formatTimeStamp
)
from nwtools import cmpList
@@ -75,6 +77,12 @@ def testColRange():
[[200, 50, 0], [162, 87, 0], [124, 124, 0], [86, 161, 0], [50, 200, 0]]
)
@pytest.mark.core
def testFormatTime():
tTime = time.mktime(time.gmtime(0))
assert formatTimeStamp(tTime, False) == "1970-01-01 00:00:00"
assert formatTimeStamp(tTime, True) == "1970-01-01 00.00.00"
@pytest.mark.core
def testFormatInt():
assert formatInt(1000) == "1000"