Source code for tests.test_lottosettingdialog
# -*- coding: utf-8 -*-
# pyLottoSimu
# Copyright (C) <2015-2024> Markus Hackspacher
# This file is part of pyLottoSimu.
# pyLottoSimu is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# pyLottoSimu is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with pyLottoSimu. If not, see <http://www.gnu.org/licenses/>.
"""Test the dialog module
lottosettingdialog
"""
import unittest
try:
from PyQt6.QtWidgets import QApplication
except ImportError:
from PyQt5.QtWidgets import QApplication
from pylottosimu.dialog.lottosettingdialog import LottoSettingsDialog
from pylottosimu.lottosystem import LottoSystemData
[docs]
class LottoSystemDataTestCase(unittest.TestCase):
"""Test of drawing
"""
[docs]
def setUp(self):
"""Creates the QApplication instance
:return: none
"""
# Simple way of making instance a singleton
super(LottoSystemDataTestCase, self).setUp()
self.app = QApplication([])
[docs]
def tearDown(self):
"""Deletes the reference owned by self
:return: none
"""
del self.app
super(LottoSystemDataTestCase, self).tearDown()
[docs]
def test_dialog(self):
"""test"""
lottosystems = LottoSystemData()
dialog = LottoSettingsDialog(lottosystems, testcase=True)
self.assertTrue(dialog)
[docs]
def test_dialogvalues(self):
"""test"""
lottosystems = LottoSystemData()
dialog = LottoSettingsDialog(lottosystems, testcase=True)
self.assertEqual(
dialog.values(),
('Lotto DE', 49, 6, False, 0, False, 0, 'Superzahl'))
if __name__ == '__main__':
unittest.main()