Changeset 53c771e in sasview for src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py
- Timestamp:
- Nov 9, 2017 8:45:20 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:
- dd150ef
- Parents:
- d6b8a1d
- git-author:
- Piotr Rozyczko <rozyczko@…> (11/08/17 09:22:45)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:45:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py
r7fb471d r53c771e 3 3 import numpy 4 4 5 from PyQt 4 import QtGui5 from PyQt5 import QtGui, QtWidgets 6 6 from unittest.mock import MagicMock 7 7 import matplotlib as mpl … … 18 18 from sas.qtgui.Plotting.ColorMap import ColorMap 19 19 20 if not Qt Gui.QApplication.instance():21 app = Qt Gui.QApplication(sys.argv)20 if not QtWidgets.QApplication.instance(): 21 app = QtWidgets.QApplication(sys.argv) 22 22 23 23 class ColorMapTest(unittest.TestCase): … … 48 48 def testDefaults(self): 49 49 '''Test the GUI in its default state''' 50 self.assertIsInstance(self.widget, Qt Gui.QDialog)50 self.assertIsInstance(self.widget, QtWidgets.QDialog) 51 51 52 52 self.assertEqual(self.widget._cmap_orig, "jet") 53 self.assertEqual(len(self.widget.all_maps), 1 44)54 self.assertEqual(len(self.widget.maps), 72)55 self.assertEqual(len(self.widget.rmaps), 72)53 self.assertEqual(len(self.widget.all_maps), 160) 54 self.assertEqual(len(self.widget.maps), 80) 55 self.assertEqual(len(self.widget.rmaps), 80) 56 56 57 57 self.assertEqual(self.widget.lblWidth.text(), "0") … … 60 60 self.assertEqual(self.widget.lblStopRadius.text(), "-1") 61 61 self.assertFalse(self.widget.chkReverse.isChecked()) 62 self.assertEqual(self.widget.cbColorMap.count(), 72)63 self.assertEqual(self.widget.cbColorMap.currentIndex(), 6 0)62 self.assertEqual(self.widget.cbColorMap.count(), 80) 63 self.assertEqual(self.widget.cbColorMap.currentIndex(), 64) 64 64 65 65 # validators … … 70 70 self.assertEqual(self.widget.txtMinAmplitude.text(), "0") 71 71 self.assertEqual(self.widget.txtMaxAmplitude.text(), "100") 72 self.assertIsInstance(self.widget.slider, Qt Gui.QSlider)72 self.assertIsInstance(self.widget.slider, QtWidgets.QSlider) 73 73 74 74 def testOnReset(self): … … 111 111 112 112 # Check the combobox 113 self.assertEqual(self.widget.cbColorMap.currentIndex(), 5 5)113 self.assertEqual(self.widget.cbColorMap.currentIndex(), 59) 114 114 self.assertFalse(self.widget.chkReverse.isChecked()) 115 115 … … 118 118 self.widget.initMapCombobox() 119 119 # Check the combobox 120 self.assertEqual(self.widget.cbColorMap.currentIndex(), 56)120 self.assertEqual(self.widget.cbColorMap.currentIndex(), 60) 121 121 self.assertTrue(self.widget.chkReverse.isChecked()) 122 122
Note: See TracChangeset
for help on using the changeset viewer.