- Timestamp:
- Aug 22, 2017 5:59:29 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- b2a5042
- Parents:
- 457d961
- Location:
- src/sas/qtgui
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/GenericScatteringCalculator.py
- Property mode changed from 100755 to 100644
r457d961 r464cd07 100 100 101 101 # plots - 3D in real space 102 self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 102 plot3d = self.plot3d(has_arrow=False) 103 self.trigger_plot_3d.connect(plot3d) 104 #self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 103 105 104 106 self.graph_num = 1 # index for name of graph -
src/sas/qtgui/Calculators/UnitTesting/DensityCalculatorTest.py
r83eb5208 r464cd07 19 19 import sas.qtgui.Utilities.LocalConfig 20 20 21 app = QtGui.QApplication(sys.argv) 21 if not QtGui.QApplication.instance(): 22 app = QtGui.QApplication(sys.argv) 22 23 23 24 class ToMolarMassTest(unittest.TestCase): -
src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py
- Property mode changed from 100755 to 100644
r457d961 r464cd07 24 24 from sas.sascalc.calculator import sas_gen 25 25 26 app = QtGui.QApplication(sys.argv) 26 if not QtGui.QApplication.instance(): 27 app = QtGui.QApplication(sys.argv) 27 28 28 29 -
src/sas/qtgui/Calculators/UnitTesting/KiessigCalculatorTest.py
r83eb5208 r464cd07 11 11 from sas.qtgui.Calculators.KiessigPanel import KiessigPanel 12 12 13 app = QtGui.QApplication(sys.argv) 13 if not QtGui.QApplication.instance(): 14 app = QtGui.QApplication(sys.argv) 14 15 15 16 -
src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py
r83eb5208 r464cd07 20 20 import sas.qtgui.Utilities.LocalConfig 21 21 22 app = QtGui.QApplication(sys.argv) 22 if not QtGui.QApplication.instance(): 23 app = QtGui.QApplication(sys.argv) 23 24 24 25 class SldResultTest(unittest.TestCase): -
src/sas/qtgui/Calculators/UnitTesting/SlitSizeCalculatorTest.py
r83eb5208 r464cd07 12 12 from sas.sascalc.dataloader.loader import Loader 13 13 14 app = QtGui.QApplication(sys.argv) 14 if not QtGui.QApplication.instance(): 15 app = QtGui.QApplication(sys.argv) 15 16 16 17 … … 87 88 self.widget.calculateSlitSize, data) 88 89 89 filename = "empty_file.txt"90 loader = Loader()91 data = loader.load(filename)92 self.assertRaisesRegexp(RuntimeError,93 "ERROR: Data hasn't been loaded correctly",94 self.widget.calculateSlitSize, data)95 96 90 data = None 97 91 self.assertRaisesRegexp(RuntimeError, -
src/sas/qtgui/GUITests.py
r72f4834 r464cd07 1 1 import unittest 2 import sys 3 from PyQt4 import QtGui 4 5 # Prepare the general QApplication instance 6 app = QtGui.QApplication(sys.argv) 2 7 3 8 # Main Window … … 30 35 from Calculators.UnitTesting import DensityCalculatorTest 31 36 from Calculators.UnitTesting import GenericScatteringCalculatorTest 37 from Calculators.UnitTesting import SLDCalculatorTest 38 from Calculators.UnitTesting import SlitSizeCalculatorTest 32 39 33 40 # Utilities … … 46 53 from Perspectives.Fitting.UnitTesting import FitPageTest 47 54 from Perspectives.Fitting.UnitTesting import FittingOptionsTest 48 49 55 50 56 def suite(): … … 84 90 unittest.makeSuite(DensityCalculatorTest.DensityCalculatorTest, 'test'), 85 91 unittest.makeSuite(GenericScatteringCalculatorTest.GenericScatteringCalculatorTest, 'test'), 92 unittest.makeSuite(SLDCalculatorTest.SLDCalculatorTest, 'test'), 93 unittest.makeSuite(SlitSizeCalculatorTest.SlitSizeCalculatorTest, 'test'), 86 94 87 95 # Perspectives -
src/sas/qtgui/MainWindow/UnitTesting/AboutBoxTest.py
r83eb5208 r464cd07 3 3 import webbrowser 4 4 5 from PyQt4 .QtGui import *5 from PyQt4 import QtGui 6 6 from PyQt4.QtTest import QTest 7 from PyQt4 .QtCore import *7 from PyQt4 import QtCore 8 8 from mock import MagicMock 9 9 … … 15 15 import sas.qtgui.Utilities.LocalConfig as LocalConfig 16 16 17 app = QApplication(sys.argv) 17 if not QtGui.QApplication.instance(): 18 app = QtGui.QApplication(sys.argv) 18 19 19 20 class AboutBoxTest(unittest.TestCase): … … 30 31 def testDefaults(self): 31 32 '''Test the GUI in its default state''' 32 self.assertIsInstance(self.widget, Q Widget)33 self.assertIsInstance(self.widget, QtGui.QWidget) 33 34 self.assertEqual(self.widget.windowTitle(), "About") 34 35 self.assertEqual(self.widget.cmdOK.text(), "OK") … … 44 45 """ 45 46 version = self.widget.lblVersion 46 self.assertIsInstance(version, Q Label)47 self.assertIsInstance(version, QtGui.QLabel) 47 48 self.assertEqual(str(version.text()), str(LocalConfig.__version__)) 48 49 … … 52 53 """ 53 54 about = self.widget.lblAbout 54 self.assertIsInstance(about, Q Label)55 self.assertIsInstance(about, QtGui.QLabel) 55 56 # build version 56 57 self.assertIn(str(LocalConfig.__build__), about.text()) … … 82 83 83 84 # Press the buttons 84 buttonList = self.widget.findChildren(Q PushButton)85 buttonList = self.widget.findChildren(QtGui.QPushButton) 85 86 for button in buttonList: 86 QTest.mouseClick(button, Qt .LeftButton)87 QTest.mouseClick(button, QtCore.Qt.LeftButton) 87 88 #open_link = webbrowser.open.call_args 88 89 args, _ = webbrowser.open.call_args … … 96 97 self.assertTrue(self.widget.isVisible()) 97 98 # Click on the OK button 98 QTest.mouseClick(self.widget.cmdOK, Qt .LeftButton)99 QTest.mouseClick(self.widget.cmdOK, QtCore.Qt.LeftButton) 99 100 # assure the widget is no longer seen 100 101 self.assertFalse(self.widget.isVisible()) -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
rdc5ef15 r464cd07 25 25 import sas.qtgui.Plotting.PlotHelper as PlotHelper 26 26 27 app = QApplication(sys.argv) 27 if not QApplication.instance(): 28 app = QApplication(sys.argv) 28 29 29 30 class DataExplorerTest(unittest.TestCase): … … 441 442 # Click on the Help button 442 443 QTest.mouseClick(button1, Qt.LeftButton) 443 qApp.processEvents()444 QtGui.qApp.processEvents() 444 445 445 446 # Check the browser … … 450 451 # Click on the Help_2 button 451 452 QTest.mouseClick(button2, Qt.LeftButton) 452 qApp.processEvents()453 QtGui.qApp.processEvents() 453 454 # Check the browser 454 455 self.assertIn(partial_url, str(self.form._helpView.url())) -
src/sas/qtgui/MainWindow/UnitTesting/DroppableDataLoadWidgetTest.py
r83eb5208 r464cd07 13 13 from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 14 14 15 app = QApplication(sys.argv) 15 if not QApplication.instance(): 16 app = QApplication(sys.argv) 16 17 17 18 class DroppableDataLoadWidgetTest(unittest.TestCase): -
src/sas/qtgui/MainWindow/UnitTesting/GuiManagerTest.py
r83eb5208 r464cd07 24 24 from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 25 25 26 app = QApplication(sys.argv) 26 if not QApplication.instance(): 27 app = QApplication(sys.argv) 27 28 28 29 class GuiManagerTest(unittest.TestCase): -
src/sas/qtgui/MainWindow/UnitTesting/MainWindowTest.py
r83eb5208 r464cd07 14 14 from sas.qtgui.MainWindow.MainWindow import SplashScreen 15 15 16 app = QtGui.QApplication(sys.argv) 16 if not QtGui.QApplication.instance(): 17 app = QtGui.QApplication(sys.argv) 17 18 18 19 class MainWindowTest(unittest.TestCase): -
src/sas/qtgui/MainWindow/UnitTesting/WelcomePanelTest.py
r83eb5208 r464cd07 10 10 from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel 11 11 12 app = QtGui.QApplication(sys.argv) 12 if not QtGui.QApplication.instance(): 13 app = QtGui.QApplication(sys.argv) 13 14 14 15 class WelcomePanelTest(unittest.TestCase): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingLogicTest.py
- Property mode changed from 100755 to 100644
rdc5ef15 r464cd07 13 13 from sas.qtgui.Plotting.PlotterData import Data1D 14 14 15 app = QtGui.QApplication(sys.argv) 15 if not QtGui.QApplication.instance(): 16 app = QtGui.QApplication(sys.argv) 16 17 17 18 -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingOptionsTest.py
r377ade1 r464cd07 16 16 from sas.qtgui.Perspectives.Fitting.FittingOptions import FittingOptions 17 17 18 app = QtGui.QApplication(sys.argv) 18 if not QtGui.QApplication.instance(): 19 app = QtGui.QApplication(sys.argv) 19 20 20 21 class FittingOptionsTest(unittest.TestCase): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py
r0e4d87c r464cd07 16 16 from sas.qtgui.Perspectives.Fitting.FittingPerspective import FittingWindow 17 17 18 app = QtGui.QApplication(sys.argv) 18 if not QtGui.QApplication.instance(): 19 app = QtGui.QApplication(sys.argv) 19 20 20 21 class FittingPerspectiveTest(unittest.TestCase): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r377ade1 r464cd07 20 20 from sas.qtgui.Plotting.PlotterData import Data2D 21 21 22 app = QtGui.QApplication(sys.argv) 22 if not QtGui.QApplication.instance(): 23 app = QtGui.QApplication(sys.argv) 23 24 24 25 class dummy_manager(object): -
src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py
r83eb5208 r464cd07 11 11 from sas.qtgui.Plotting.AddText import AddText 12 12 13 app = QtGui.QApplication(sys.argv) 13 if not QtGui.QApplication.instance(): 14 app = QtGui.QApplication(sys.argv) 14 15 15 16 class AddTextTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/BoxSumTest.py
r83eb5208 r464cd07 12 12 from sas.qtgui.Plotting.BoxSum import BoxSum 13 13 14 app = QtGui.QApplication(sys.argv) 14 if not QtGui.QApplication.instance(): 15 app = QtGui.QApplication(sys.argv) 15 16 16 17 class BoxSumTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py
rdc5ef15 r464cd07 18 18 from sas.qtgui.Plotting.ColorMap import ColorMap 19 19 20 app = QtGui.QApplication(sys.argv) 20 if not QtGui.QApplication.instance(): 21 app = QtGui.QApplication(sys.argv) 21 22 22 23 class ColorMapTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py
rdc5ef15 r464cd07 15 15 from sas.qtgui.Plotting.LinearFit import LinearFit 16 16 17 app = QtGui.QApplication(sys.argv) 17 if not QtGui.QApplication.instance(): 18 app = QtGui.QApplication(sys.argv) 18 19 19 20 class LinearFitTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py
r83eb5208 r464cd07 11 11 from sas.qtgui.Plotting.PlotProperties import PlotProperties 12 12 13 app = QtGui.QApplication(sys.argv) 13 if not QtGui.QApplication.instance(): 14 app = QtGui.QApplication(sys.argv) 14 15 15 16 class PlotPropertiesTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
rdc5ef15 r464cd07 19 19 import sas.qtgui.Plotting.Plotter2D as Plotter2D 20 20 21 app = QtGui.QApplication(sys.argv) 21 if not QtGui.QApplication.instance(): 22 app = QtGui.QApplication(sys.argv) 22 23 23 24 class Plotter2DTest(unittest.TestCase): … … 159 160 def done(): 160 161 self.clipboard_called = True 161 QtCore.QObject.connect( app.clipboard(), QtCore.SIGNAL("dataChanged()"), done)162 QtCore.QObject.connect(QtGui.qApp.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 162 163 actions[2].trigger() 163 164 QtGui.qApp.processEvents() -
src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py
rdc5ef15 r464cd07 20 20 import sas.qtgui.Plotting.PlotterBase as PlotterBase 21 21 22 app = QtGui.QApplication(sys.argv) 22 if not QtGui.QApplication.instance(): 23 app = QtGui.QApplication(sys.argv) 23 24 24 25 class PlotterBaseTest(unittest.TestCase): … … 149 150 def done(): 150 151 self.clipboard_called = True 151 QtCore.QObject.connect( app.clipboard(), QtCore.SIGNAL("dataChanged()"), done)152 QtCore.QObject.connect(QtGui.qApp.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 152 153 actions[2].trigger() 153 154 QtGui.qApp.processEvents() -
src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
rdc5ef15 r464cd07 20 20 import sas.qtgui.Plotting.Plotter as Plotter 21 21 22 app = QtGui.QApplication(sys.argv) 22 if not QtGui.QApplication.instance(): 23 app = QtGui.QApplication(sys.argv) 23 24 24 25 … … 97 98 def done(): 98 99 self.clipboard_called = True 99 QtCore.QObject.connect( app.clipboard(), QtCore.SIGNAL("dataChanged()"), done)100 QtCore.QObject.connect(QtGui.qApp.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 100 101 actions[2].trigger() 101 102 QtGui.qApp.processEvents() -
src/sas/qtgui/Plotting/UnitTesting/ScalePropertiesTest.py
r83eb5208 r464cd07 10 10 from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 11 11 12 app = QtGui.QApplication(sys.argv) 12 if not QtGui.QApplication.instance(): 13 app = QtGui.QApplication(sys.argv) 13 14 14 15 class ScalePropertiesTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/SetGraphRangeTest.py
r83eb5208 r464cd07 10 10 from sas.qtgui.Plotting.SetGraphRange import SetGraphRange 11 11 12 app = QtGui.QApplication(sys.argv) 12 if not QtGui.QApplication.instance(): 13 app = QtGui.QApplication(sys.argv) 13 14 14 15 class SetGraphRangeTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/SlicerModelTest.py
r83eb5208 r464cd07 12 12 from sas.qtgui.Plotting.SlicerModel import SlicerModel 13 13 14 app = QtGui.QApplication(sys.argv) 14 if not QtGui.QApplication.instance(): 15 app = QtGui.QApplication(sys.argv) 15 16 16 17 class SlicerModelTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/SlicerParametersTest.py
- Property mode changed from 100755 to 100644
r83eb5208 r464cd07 18 18 from sas.qtgui.Plotting.SlicerParameters import SlicerParameters 19 19 20 app = QtGui.QApplication(sys.argv) 20 if not QtGui.QApplication.instance(): 21 app = QtGui.QApplication(sys.argv) 21 22 22 23 class SlicerParametersTest(unittest.TestCase): -
src/sas/qtgui/Plotting/UnitTesting/WindowTitleTest.py
r83eb5208 r464cd07 10 10 from sas.qtgui.Plotting.WindowTitle import WindowTitle 11 11 12 app = QtGui.QApplication(sys.argv) 12 if not QtGui.QApplication.instance(): 13 app = QtGui.QApplication(sys.argv) 13 14 14 15 class WindowTitleTest(unittest.TestCase): … … 32 33 '''Modify the title''' 33 34 self.widget.show() 34 app.processEvents()35 QtGui.qApp.processEvents() 35 36 # make sure we have the pre-set title 36 37 self.assertEqual(self.widget.txtTitle.text(), "some title") … … 38 39 self.widget.txtTitle.clear() 39 40 self.widget.txtTitle.setText("5 elephants") 40 app.processEvents()41 QtGui.qApp.processEvents() 41 42 # Retrieve value 42 43 new_title = self.widget.title() -
src/sas/qtgui/UnitTesting/TestUtilsTest.py
r83eb5208 r464cd07 11 11 from sas.qtgui.UnitTesting.TestUtils import * 12 12 13 app = QApplication(sys.argv) 13 if not QApplication.instance(): 14 app = QApplication(sys.argv) 14 15 15 16 class TestUtilsTest(unittest.TestCase): -
src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py
rdc5ef15 r464cd07 19 19 from sas.qtgui.Utilities.GuiUtils import * 20 20 21 app = QtGui.QApplication(sys.argv) 21 if not QtGui.QApplication.instance(): 22 app = QtGui.QApplication(sys.argv) 22 23 23 24 class GuiUtilsTest(unittest.TestCase): -
src/sas/qtgui/Utilities/UnitTesting/SasviewLoggerTest.py
r83eb5208 r464cd07 13 13 from sas.qtgui.Utilities.SasviewLogger import QtHandler 14 14 15 app = QApplication(sys.argv) 15 if not QApplication.instance(): 16 app = QApplication(sys.argv) 16 17 17 18 class SasviewLoggerTest(unittest.TestCase):
Note: See TracChangeset
for help on using the changeset viewer.