source: sasview/src/sas/qtgui/GUITests.py @ 32f6cdd

ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 32f6cdd was 32f6cdd, checked in by Torin Cooper-Bennun <torin.cooper-bennun@…>, 10 months ago

add documentation to GUITests

  • Property mode set to 100644
File size: 7.5 KB
Line 
1import unittest
2import sys
3from PyQt5 import QtGui
4from PyQt5 import QtWidgets
5
6"""
7Unit tests for the QT GUI
8=========================
9
10In order to run the tests, first install SasView and sasmodels to site-packages
11by running ``python setup.py install`` in the root git directories of both of
12the repositories.
13
14The tests can be run with `python GUITests.py`, or to get more verbose console
15output (recommended), use `python GUITests.py -v`.
16"""
17
18# Prepare the general QApplication instance
19app = QtWidgets.QApplication(sys.argv)
20
21# Main Window
22from MainWindow.UnitTesting import AboutBoxTest
23from MainWindow.UnitTesting import DataExplorerTest
24from MainWindow.UnitTesting import WelcomePanelTest
25from MainWindow.UnitTesting import DroppableDataLoadWidgetTest
26from MainWindow.UnitTesting import GuiManagerTest
27from MainWindow.UnitTesting import MainWindowTest
28
29## Plotting
30from Plotting.UnitTesting import AddTextTest
31from Plotting.UnitTesting import PlotHelperTest
32from Plotting.UnitTesting import WindowTitleTest
33from Plotting.UnitTesting import ScalePropertiesTest
34from Plotting.UnitTesting import SetGraphRangeTest
35from Plotting.UnitTesting import LinearFitTest
36from Plotting.UnitTesting import PlotPropertiesTest
37from Plotting.UnitTesting import PlotUtilitiesTest
38from Plotting.UnitTesting import ColorMapTest
39from Plotting.UnitTesting import BoxSumTest
40from Plotting.UnitTesting import SlicerModelTest
41from Plotting.UnitTesting import SlicerParametersTest
42from Plotting.UnitTesting import PlotterBaseTest
43from Plotting.UnitTesting import PlotterTest
44from Plotting.UnitTesting import Plotter2DTest
45
46# Calculators
47from Calculators.UnitTesting import KiessigCalculatorTest
48from Calculators.UnitTesting import DensityCalculatorTest
49from Calculators.UnitTesting import GenericScatteringCalculatorTest
50from Calculators.UnitTesting import SLDCalculatorTest
51from Calculators.UnitTesting import SlitSizeCalculatorTest
52from Calculators.UnitTesting import ResolutionCalculatorPanelTest
53from Calculators.UnitTesting import DataOperationUtilityTest
54
55# Utilities
56from Utilities.UnitTesting import GuiUtilsTest
57from Utilities.UnitTesting import SasviewLoggerTest
58from Utilities.UnitTesting import GridPanelTest
59from Utilities.UnitTesting import ModelEditorTest
60from Utilities.UnitTesting import PluginDefinitionTest
61from Utilities.UnitTesting import TabbedModelEditorTest
62from Utilities.UnitTesting import AddMultEditorTest
63from Utilities.UnitTesting import ReportDialogTest
64
65# Unit Testing
66from UnitTesting import TestUtilsTest
67
68# Perspectives
69#  Fitting
70from Perspectives.Fitting.UnitTesting import FittingWidgetTest
71from Perspectives.Fitting.UnitTesting import FittingPerspectiveTest
72from Perspectives.Fitting.UnitTesting import FittingLogicTest
73from Perspectives.Fitting.UnitTesting import FittingUtilitiesTest
74from Perspectives.Fitting.UnitTesting import FitPageTest
75from Perspectives.Fitting.UnitTesting import FittingOptionsTest
76from Perspectives.Fitting.UnitTesting import MultiConstraintTest
77from Perspectives.Fitting.UnitTesting import ComplexConstraintTest
78from Perspectives.Fitting.UnitTesting import ConstraintWidgetTest
79
80#  Invariant
81from Perspectives.Invariant.UnitTesting import InvariantPerspectiveTest
82
83#  Inversion
84from Perspectives.Inversion.UnitTesting import InversionPerspectiveTest
85
86def suite():
87    suites = (
88        # Plotting
89        unittest.makeSuite(Plotter2DTest.Plotter2DTest,               'test'),
90        unittest.makeSuite(PlotHelperTest.PlotHelperTest,             'test'),
91        unittest.makeSuite(AddTextTest.AddTextTest,                   'test'),
92        unittest.makeSuite(WindowTitleTest.WindowTitleTest,           'test'),
93        unittest.makeSuite(ScalePropertiesTest.ScalePropertiesTest,   'test'),
94        unittest.makeSuite(SetGraphRangeTest.SetGraphRangeTest,       'test'),
95        unittest.makeSuite(LinearFitTest.LinearFitTest,               'test'),
96        unittest.makeSuite(PlotPropertiesTest.PlotPropertiesTest,     'test'),
97        unittest.makeSuite(PlotUtilitiesTest.PlotUtilitiesTest,       'test'),
98        unittest.makeSuite(ColorMapTest.ColorMapTest,                 'test'),
99        unittest.makeSuite(BoxSumTest.BoxSumTest,                     'test'),
100        unittest.makeSuite(SlicerModelTest.SlicerModelTest,           'test'),
101        unittest.makeSuite(SlicerParametersTest.SlicerParametersTest, 'test'),
102        unittest.makeSuite(PlotterBaseTest.PlotterBaseTest,           'test'),
103        unittest.makeSuite(PlotterTest.PlotterTest,                   'test'),
104
105        # Main window
106        unittest.makeSuite(DataExplorerTest.DataExplorerTest,  'test'),
107        unittest.makeSuite(DroppableDataLoadWidgetTest.DroppableDataLoadWidgetTest, 'test'),
108        unittest.makeSuite(MainWindowTest.MainWindowTest,      'test'),
109        unittest.makeSuite(GuiManagerTest.GuiManagerTest,      'test'),
110        unittest.makeSuite(AboutBoxTest.AboutBoxTest,          'test'),
111        unittest.makeSuite(WelcomePanelTest.WelcomePanelTest,  'test'),
112
113        # Utilities
114        unittest.makeSuite(TestUtilsTest.TestUtilsTest,           'test'),
115        unittest.makeSuite(SasviewLoggerTest.SasviewLoggerTest,   'test'),
116        unittest.makeSuite(GuiUtilsTest.GuiUtilsTest,             'test'),
117        unittest.makeSuite(GuiUtilsTest.DoubleValidatorTest,      'test'),
118        unittest.makeSuite(GuiUtilsTest.HashableStandardItemTest, 'test'),
119        unittest.makeSuite(GridPanelTest.BatchOutputPanelTest,    'test'),
120        unittest.makeSuite(ModelEditorTest.ModelEditorTest,            'test'),
121        unittest.makeSuite(PluginDefinitionTest.PluginDefinitionTest,  'test'),
122        unittest.makeSuite(TabbedModelEditorTest.TabbedModelEditorTest,'test'),
123        unittest.makeSuite(AddMultEditorTest.AddMultEditorTest, 'test'),
124        unittest.makeSuite(ReportDialogTest.ReportDialogTest,     'test'),
125
126        # Calculators
127        unittest.makeSuite(KiessigCalculatorTest.KiessigCalculatorTest,                     'test'),
128        unittest.makeSuite(DensityCalculatorTest.DensityCalculatorTest,                     'test'),
129        unittest.makeSuite(GenericScatteringCalculatorTest.GenericScatteringCalculatorTest, 'test'),
130        unittest.makeSuite(SLDCalculatorTest.SLDCalculatorTest, 'test'),
131        unittest.makeSuite(SlitSizeCalculatorTest.SlitSizeCalculatorTest, 'test'),
132        unittest.makeSuite(ResolutionCalculatorPanelTest.ResolutionCalculatorPanelTest, 'test'),
133        unittest.makeSuite(DataOperationUtilityTest.DataOperationUtilityTest, 'test'),
134
135        # Perspectives
136        #  Fitting
137        unittest.makeSuite(FittingPerspectiveTest.FittingPerspectiveTest, 'test'),
138        unittest.makeSuite(FittingWidgetTest.FittingWidgetTest,           'test'),
139        unittest.makeSuite(FittingLogicTest.FittingLogicTest,             'test'),
140        unittest.makeSuite(FittingUtilitiesTest.FittingUtilitiesTest,     'test'),
141        unittest.makeSuite(FitPageTest.FitPageTest,                       'test'),
142        unittest.makeSuite(FittingOptionsTest.FittingOptionsTest,         'test'),
143        unittest.makeSuite(MultiConstraintTest.MultiConstraintTest,       'test'),
144        unittest.makeSuite(ConstraintWidgetTest.ConstraintWidgetTest,     'test'),
145        unittest.makeSuite(ComplexConstraintTest.ComplexConstraintTest,   'test'),
146
147        #  Invariant
148        unittest.makeSuite(InvariantPerspectiveTest.InvariantPerspectiveTest,  'test'),
149        #  Inversion
150        unittest.makeSuite(InversionPerspectiveTest.InversionTest,  'test'),
151        )
152    return unittest.TestSuite(suites)
153
154if __name__ == "__main__":
155    unittest.main(defaultTest="suite")
156
Note: See TracBrowser for help on using the repository browser.