Remove dependency on .mainConf class variable in tests

This commit is contained in:
Veronica Berglyd Olsen
2023-05-16 00:40:56 +02:00
parent cdb501ae26
commit 7f8ffb228e
14 changed files with 67 additions and 54 deletions
+5 -3
View File
@@ -21,11 +21,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
import pytest
from mock import causeException
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtGui import QTextCursor
from PyQt5.QtWidgets import qApp, QAction
from mock import causeException
from novelwriter import CONFIG
from novelwriter.enum import nwDocAction
from novelwriter.core.tohtml import ToHtml
@@ -134,10 +136,10 @@ def testGuiViewer_Main(qtbot, monkeypatch, nwGUI, nwLipsum):
assert nwGUI.docViewer.docHeader.theTitle.text() == "Characters Test Title"
# Ttile without full path
nwGUI.mainConf.showFullPath = False
CONFIG.showFullPath = False
nwGUI.docViewer.updateDocInfo("4c4f28287af27")
assert nwGUI.docViewer.docHeader.theTitle.text() == "Test Title"
nwGUI.mainConf.showFullPath = True
CONFIG.showFullPath = True
# Document footer show/hide references
viewState = nwGUI.viewMeta.isVisible()