source: sasview/src/sas/qtgui/GUITests.py @ 6138f73

Last change on this file since 6138f73 was d0528c4, checked in by Torin Cooper-Bennun <torin.cooper-bennun@…>, 6 years ago

corrections to GUITests doc

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