Ignore:
Timestamp:
Nov 9, 2017 8:45:20 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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)
Message:

Converted unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py

    r7fb471d r53c771e  
    33import numpy 
    44 
    5 from PyQt4 import QtGui 
     5from PyQt5 import QtGui, QtWidgets 
    66from unittest.mock import MagicMock 
    77import matplotlib as mpl 
     
    1818from sas.qtgui.Plotting.ColorMap import ColorMap 
    1919 
    20 if not QtGui.QApplication.instance(): 
    21     app = QtGui.QApplication(sys.argv) 
     20if not QtWidgets.QApplication.instance(): 
     21    app = QtWidgets.QApplication(sys.argv) 
    2222 
    2323class ColorMapTest(unittest.TestCase): 
     
    4848    def testDefaults(self): 
    4949        '''Test the GUI in its default state''' 
    50         self.assertIsInstance(self.widget, QtGui.QDialog) 
     50        self.assertIsInstance(self.widget, QtWidgets.QDialog) 
    5151 
    5252        self.assertEqual(self.widget._cmap_orig, "jet") 
    53         self.assertEqual(len(self.widget.all_maps), 144) 
    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) 
    5656 
    5757        self.assertEqual(self.widget.lblWidth.text(), "0") 
     
    6060        self.assertEqual(self.widget.lblStopRadius.text(), "-1") 
    6161        self.assertFalse(self.widget.chkReverse.isChecked()) 
    62         self.assertEqual(self.widget.cbColorMap.count(), 72) 
    63         self.assertEqual(self.widget.cbColorMap.currentIndex(), 60) 
     62        self.assertEqual(self.widget.cbColorMap.count(), 80) 
     63        self.assertEqual(self.widget.cbColorMap.currentIndex(), 64) 
    6464 
    6565        # validators 
     
    7070        self.assertEqual(self.widget.txtMinAmplitude.text(), "0") 
    7171        self.assertEqual(self.widget.txtMaxAmplitude.text(), "100") 
    72         self.assertIsInstance(self.widget.slider, QtGui.QSlider) 
     72        self.assertIsInstance(self.widget.slider, QtWidgets.QSlider) 
    7373 
    7474    def testOnReset(self): 
     
    111111 
    112112        # Check the combobox 
    113         self.assertEqual(self.widget.cbColorMap.currentIndex(), 55) 
     113        self.assertEqual(self.widget.cbColorMap.currentIndex(), 59) 
    114114        self.assertFalse(self.widget.chkReverse.isChecked()) 
    115115 
     
    118118        self.widget.initMapCombobox() 
    119119        # Check the combobox 
    120         self.assertEqual(self.widget.cbColorMap.currentIndex(), 56) 
     120        self.assertEqual(self.widget.cbColorMap.currentIndex(), 60) 
    121121        self.assertTrue(self.widget.chkReverse.isChecked()) 
    122122 
Note: See TracChangeset for help on using the changeset viewer.