manuskript/manuskript/tests/ui/test_welcome.py

23 lines
628 B
Python

#!/usr/bin/env python
# --!-- coding: utf8 --!--
"""Tests for the welcome widget."""
def test_autoLoad(MWNoProject):
"""
Tests for the welcome widget using MainWindow with no open project.
"""
MW = MWNoProject
from PyQt5.QtCore import QSettings
# Testing when no autoLoad
QSettings().remove("autoLoad")
autoLoad, path = MW.welcome.getAutoLoadValues()
assert type(autoLoad) == bool
assert autoLoad == False
for v in [True, False, 42, "42", None, True]:
MW.welcome.setAutoLoad(v)
autoLoad, path = MW.welcome.getAutoLoadValues()
assert type(autoLoad) == bool