source: sasview/src/sas/qtgui/UnitTesting/ColorMapTest.py @ 092a3d9

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 092a3d9 was 092a3d9, checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago

Color Map control for 2D charts. Initial commit - SASVIEW-391

  • Property mode set to 100755
File size: 2.4 KB
Line 
1import sys
2import unittest
3import numpy
4
5from PyQt4 import QtGui
6from mock import MagicMock
7
8# set up import paths
9import path_prepare
10
11from sas.sasgui.guiframe.dataFitting import Data2D
12import sas.qtgui.Plotter2D as Plotter2D
13from UnitTesting.TestUtils import WarningTestNotImplemented
14
15# Local
16from sas.qtgui.ColorMap import ColorMap
17
18app = QtGui.QApplication(sys.argv)
19
20class ColorMapTest(unittest.TestCase):
21    '''Test the ColorMap'''
22    def setUp(self):
23        '''Create the ColorMap'''
24        self.plotter = Plotter2D.Plotter2D(None, quickplot=True)
25
26        self.data = Data2D(image=[0.1]*4,
27                           qx_data=[1.0, 2.0, 3.0, 4.0],
28                           qy_data=[10.0, 11.0, 12.0, 13.0],
29                           dqx_data=[0.1, 0.2, 0.3, 0.4],
30                           dqy_data=[0.1, 0.2, 0.3, 0.4],
31                           q_data=[1,2,3,4],
32                           xmin=-1.0, xmax=5.0,
33                           ymin=-1.0, ymax=15.0,
34                           zmin=-1.0, zmax=20.0)
35
36        self.data.title="Test data"
37        self.data.id = 1
38        self.widget = ColorMap(parent=self.plotter, data=self.data)
39
40    def tearDown(self):
41        '''Destroy the GUI'''
42        self.widget.close()
43        self.widget = None
44
45    def testDefaults(self):
46        '''Test the GUI in its default state'''
47        self.assertIsInstance(self.widget, QtGui.QDialog)
48
49        WarningTestNotImplemented()
50
51    def testOnReset(self):
52        '''Check the dialog reset function'''
53        WarningTestNotImplemented()
54
55    def testInitDetectorData(self):
56        '''Check the detector data generator'''
57        # possibly to fold into testDefaults
58        WarningTestNotImplemented()
59
60    def testInitMapCombobox(self):
61        '''Test the combo box initializer'''
62        # possible to fold into testDefaults
63        WarningTestNotImplemented()
64
65    def testOnMapIndexChange(self):
66        '''Test the response to the combo box index change'''
67        WarningTestNotImplemented()
68
69    def testRedrawColorBar(self):
70        '''Test the color bar redrawing'''
71        WarningTestNotImplemented()
72
73    def testOnColorMapReversed(self):
74        '''Test reversing the color map functionality'''
75        WarningTestNotImplemented()
76
77    def testOnAmplitudeChange(self):
78        '''Check the callback method for responding to changes in textboxes'''
79        WarningTestNotImplemented()
80
81
82if __name__ == "__main__":
83    unittest.main()
Note: See TracBrowser for help on using the repository browser.