test_gui.py 849 Bytes
Newer Older
1
import unittest
Josef Brandt's avatar
Josef Brandt committed
2
from pytestqt import qtbot
3 4 5
from PyQt5.QtWidgets import QApplication
import sys

Josef Brandt's avatar
Josef Brandt committed
6 7 8
from gui.mainView import MainView
from gui.measureModes import CrossBoxesControls

9 10 11
app = QApplication(sys.argv)


Josef Brandt's avatar
Josef Brandt committed
12 13 14 15 16 17
def test_hello(qtbot):
    widget = MainView()
    qtbot.addWidget(widget)
    print('nu')


18

Josef Brandt's avatar
Josef Brandt committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32
#
# class TestMainViewGUI(unittest.TestCase):
#     def setUp(self) -> None:
#         # self.qbot = qtbot.QtBot(None)
#         self.mainView: MainView = MainView()
#         # self.qbot.addWidget(self.mainView)
#
#     def test_switchModes_modes(self, qtbot = qtbot.QtBot):
#         self.mainView._activate_mode('crossSelection')
#         controls = self.mainView.activeModeControl
#         self.assertTrue(type(controls) == CrossBoxesControls)
#
#         numBoxComboBox = controls.numBoxesSelector
#         qtbot.addWidget(self.mainView)