Index: src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,61 @@
+import sys
+import unittest
+from mock import MagicMock
+
+from PyQt4 import QtGui
+
+# set up import paths
+import path_prepare
+
+# Local
+from sas.qtgui.Plotting.AddText import AddText
+
+app = QtGui.QApplication(sys.argv)
+
+class AddTextTest(unittest.TestCase):
+    '''Test the AddText'''
+    def setUp(self):
+        '''Create the AddText'''
+        self.widget = AddText(None)
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+        self.assertIsInstance(self.widget._font, QtGui.QFont)
+        self.assertEqual(self.widget._color, "black")
+        
+    def testOnFontChange(self):
+        '''Test the QFontDialog output'''
+        font_1 = QtGui.QFont("Helvetica", 15)
+        QtGui.QFontDialog.getFont = MagicMock(return_value=(font_1, True))
+        # Call the method
+        self.widget.onFontChange(None)
+        # Check that the text field got the new font info
+        self.assertEqual(self.widget.textEdit.currentFont(), font_1)
+
+        # See that rejecting the dialog doesn't modify the font
+        font_2 = QtGui.QFont("Arial", 9)
+        QtGui.QFontDialog.getFont = MagicMock(return_value=(font_2, False))
+        # Call the method
+        self.widget.onFontChange(None)
+        # Check that the text field retained the previous font info
+        self.assertEqual(self.widget.textEdit.currentFont(), font_1)
+
+    def testOnColorChange(self):
+        ''' Test the QColorDialog output'''
+        new_color = QtGui.QColor("red")
+        QtGui.QColorDialog.getColor = MagicMock(return_value=new_color)
+        # Call the method
+        self.widget.onColorChange(None)
+        # Check that the text field got the new color info for text
+        self.assertEqual(self.widget.textEdit.palette().color(QtGui.QPalette.Text), new_color)
+        # ... and the hex value of this color is correct
+        self.assertEqual(self.widget.color(), "#ff0000")
+        
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/BoxSumTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/BoxSumTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/BoxSumTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,47 @@
+import sys
+import unittest
+from mock import MagicMock
+
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+
+# set up import paths
+import path_prepare
+
+# Local
+from sas.qtgui.Plotting.BoxSum import BoxSum
+
+app = QtGui.QApplication(sys.argv)
+
+class BoxSumTest(unittest.TestCase):
+    '''Test the BoxSum'''
+    def setUp(self):
+        '''Create the BoxSum'''
+        # example model
+        model = QtGui.QStandardItemModel()
+        parameters = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
+        for index, parameter in enumerate(parameters):
+            model.setData(model.index(0, index),
+                    QtCore.QVariant(parameter))
+        self.widget = BoxSum(None, model=model)
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(0), QtGui.QLineEdit)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(1), QtGui.QLineEdit)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(2), QtGui.QLineEdit)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(3), QtGui.QLineEdit)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(4), QtGui.QLabel)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(5), QtGui.QLabel)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(6), QtGui.QLabel)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(7), QtGui.QLabel)
+        self.assertIsInstance(self.widget.mapper.mappedWidgetAt(8), QtGui.QLabel)
+        
+        
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,200 @@
+import sys
+import unittest
+import numpy
+
+from PyQt4 import QtGui
+from mock import MagicMock
+import matplotlib as mpl
+
+# set up import paths
+import path_prepare
+
+from sas.sasgui.guiframe.dataFitting import Data2D
+import sas.qtgui.Plotting.Plotter2D as Plotter2D
+from UnitTesting.TestUtils import WarningTestNotImplemented
+from UnitTesting.TestUtils import QtSignalSpy
+
+# Local
+from sas.qtgui.Plotting.ColorMap import ColorMap
+
+app = QtGui.QApplication(sys.argv)
+
+class ColorMapTest(unittest.TestCase):
+    '''Test the ColorMap'''
+    def setUp(self):
+        '''Create the ColorMap'''
+        self.plotter = Plotter2D.Plotter2D(None, quickplot=True)
+
+        self.data = Data2D(image=[0.1]*4,
+                           qx_data=[1.0, 2.0, 3.0, 4.0],
+                           qy_data=[10.0, 11.0, 12.0, 13.0],
+                           dqx_data=[0.1, 0.2, 0.3, 0.4],
+                           dqy_data=[0.1, 0.2, 0.3, 0.4],
+                           q_data=[1,2,3,4],
+                           xmin=-1.0, xmax=5.0,
+                           ymin=-1.0, ymax=15.0,
+                           zmin=-1.0, zmax=20.0)
+
+        self.data.title="Test data"
+        self.data.id = 1
+        self.widget = ColorMap(parent=self.plotter, data=self.data)
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+
+        self.assertEqual(self.widget._cmap_orig, "jet")
+        self.assertEqual(len(self.widget.all_maps), 144)
+        self.assertEqual(len(self.widget.maps), 72)
+        self.assertEqual(len(self.widget.rmaps), 72)
+
+        self.assertEqual(self.widget.lblWidth.text(), "0")
+        self.assertEqual(self.widget.lblHeight.text(), "0")
+        self.assertEqual(self.widget.lblQmax.text(), "15.8")
+        self.assertEqual(self.widget.lblStopRadius.text(), "-1")
+        self.assertFalse(self.widget.chkReverse.isChecked())
+        self.assertEqual(self.widget.cbColorMap.count(), 72)
+        self.assertEqual(self.widget.cbColorMap.currentIndex(), 60)
+
+        # validators
+        self.assertIsInstance(self.widget.txtMinAmplitude.validator(), QtGui.QDoubleValidator)
+        self.assertIsInstance(self.widget.txtMaxAmplitude.validator(), QtGui.QDoubleValidator)
+
+        # Ranges
+        self.assertEqual(self.widget.txtMinAmplitude.text(), "0")
+        self.assertEqual(self.widget.txtMaxAmplitude.text(), "100")
+        self.assertIsInstance(self.widget.slider, QtGui.QSlider)
+
+    def testOnReset(self):
+        '''Check the dialog reset function'''
+        # Set some controls to non-default state
+        self.widget.cbColorMap.setCurrentIndex(20)
+        self.widget.chkReverse.setChecked(True)
+        self.widget.txtMinAmplitude.setText("20.0")
+
+        # Reset the widget state
+        self.widget.onReset()
+
+        # Assure things went back to default
+        self.assertEqual(self.widget.cbColorMap.currentIndex(), 20)
+        self.assertFalse(self.widget.chkReverse.isChecked())
+        self.assertEqual(self.widget.txtMinAmplitude.text(), "0")
+
+    def testOnApply(self):
+        '''Check the dialog apply function'''
+        # Set some controls to non-default state
+        self.widget.show()
+        self.widget.cbColorMap.setCurrentIndex(20) # PuRd_r
+        self.widget.chkReverse.setChecked(True)
+        self.widget.txtMinAmplitude.setText("20.0")
+
+        spy_apply = QtSignalSpy(self.widget, self.widget.apply_signal)
+        # Reset the widget state
+        self.widget.onApply()
+
+        # Assure the widget is still up and the signal was sent.
+        self.assertTrue(self.widget.isVisible())
+        self.assertEqual(spy_apply.count(), 1)
+        self.assertIn('PuRd_r', spy_apply.called()[0]['args'][1])
+
+    def testInitMapCombobox(self):
+        '''Test the combo box initializer'''
+        # Set a color map from the direct list
+        self.widget._cmap = "gnuplot"
+        self.widget.initMapCombobox()
+
+        # Check the combobox
+        self.assertEqual(self.widget.cbColorMap.currentIndex(), 55)
+        self.assertFalse(self.widget.chkReverse.isChecked())
+
+        # Set a reversed value
+        self.widget._cmap = "hot_r"
+        self.widget.initMapCombobox()
+        # Check the combobox
+        self.assertEqual(self.widget.cbColorMap.currentIndex(), 56)
+        self.assertTrue(self.widget.chkReverse.isChecked())
+
+    def testInitRangeSlider(self):
+        '''Test the range slider initializer'''
+        # Set a color map from the direct list
+        self.widget._cmap = "gnuplot"
+        self.widget.initRangeSlider()
+
+        # Check the values
+        self.assertEqual(self.widget.slider.minimum(), 0)
+        self.assertEqual(self.widget.slider.maximum(), 100)
+        self.assertEqual(self.widget.slider.orientation(), 1)
+
+        # Emit new low value
+        self.widget.slider.lowValueChanged.emit(5)
+        # Assure the widget received changes
+        self.assertEqual(self.widget.txtMinAmplitude.text(), "5")
+
+        # Emit new high value
+        self.widget.slider.highValueChanged.emit(45)
+        # Assure the widget received changes
+        self.assertEqual(self.widget.txtMinAmplitude.text(), "45")
+
+    def testOnMapIndexChange(self):
+        '''Test the response to the combo box index change'''
+
+        self.widget.canvas.draw = MagicMock()
+        mpl.colorbar.ColorbarBase = MagicMock()
+
+        # simulate index change
+        self.widget.cbColorMap.setCurrentIndex(1)
+
+        # Check that draw() got called
+        self.assertTrue(self.widget.canvas.draw.called)
+        self.assertTrue(mpl.colorbar.ColorbarBase.called)
+
+    def testOnColorMapReversed(self):
+        '''Test reversing the color map functionality'''
+        # Check the defaults
+        self.assertEqual(self.widget._cmap, "jet")
+        self.widget.cbColorMap.addItems = MagicMock()
+
+        # Reverse the choice
+        self.widget.onColorMapReversed(True)
+
+        # check the behaviour
+        self.assertEqual(self.widget._cmap, "jet_r")
+        self.assertTrue(self.widget.cbColorMap.addItems.called)
+
+    def testOnAmplitudeChange(self):
+        '''Check the callback method for responding to changes in textboxes'''
+        self.widget.canvas.draw = MagicMock()
+        mpl.colors.Normalize = MagicMock()
+        mpl.colorbar.ColorbarBase = MagicMock()
+
+        self.widget.vmin = 0.0
+        self.widget.vmax = 100.0
+
+        # good values in fields
+        self.widget.txtMinAmplitude.setText("1.0")
+        self.widget.txtMaxAmplitude.setText("10.0")
+
+        self.widget.onAmplitudeChange()
+
+        # Check the arguments to Normalize
+        mpl.colors.Normalize.assert_called_with(vmin=1.0, vmax=10.0)
+        self.assertTrue(self.widget.canvas.draw.called)
+
+        # Bad values in fields
+        self.widget.txtMinAmplitude.setText("cake")
+        self.widget.txtMaxAmplitude.setText("more cake")
+
+        self.widget.onAmplitudeChange()
+
+        # Check the arguments to Normalize - should be defaults
+        mpl.colors.Normalize.assert_called_with(vmin=0.0, vmax=100.0)
+        self.assertTrue(self.widget.canvas.draw.called)
+
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,148 @@
+import sys
+import unittest
+import numpy
+
+from PyQt4 import QtGui
+from mock import MagicMock
+
+# set up import paths
+import path_prepare
+
+from sas.sasgui.guiframe.dataFitting import Data1D
+import sas.qtgui.Plotting.Plotter as Plotter
+
+# Local
+from sas.qtgui.Plotting.LinearFit import LinearFit
+
+app = QtGui.QApplication(sys.argv)
+
+class LinearFitTest(unittest.TestCase):
+    '''Test the LinearFit'''
+    def setUp(self):
+        '''Create the LinearFit'''
+        self.data = Data1D(x=[1.0, 2.0, 3.0],
+                           y=[10.0, 11.0, 12.0],
+                           dx=[0.1, 0.2, 0.3],
+                           dy=[0.1, 0.2, 0.3])
+        plotter = Plotter.Plotter(None, quickplot=True)
+        self.widget = LinearFit(parent=plotter, data=self.data, xlabel="log10(x^2)", ylabel="log10(y)")
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+        self.assertEqual(self.widget.windowTitle(), "Linear Fit")
+        self.assertEqual(self.widget.txtA.text(), "1")
+        self.assertEqual(self.widget.txtB.text(), "1")
+        self.assertEqual(self.widget.txtAerr.text(), "0")
+        self.assertEqual(self.widget.txtBerr.text(), "0")
+
+        self.assertEqual(self.widget.lblRange.text(), "Fit range of log10(x^2)")
+
+    def testFit(self):
+        '''Test the fitting wrapper '''
+        # Catch the update signal
+        self.widget.parent.emit = MagicMock()
+
+        # Set some initial values
+        self.widget.txtRangeMin.setText("1.0")
+        self.widget.txtRangeMax.setText("3.0")
+        self.widget.txtFitRangeMin.setText("1.0")
+        self.widget.txtFitRangeMax.setText("3.0")
+        # Run the fitting
+        self.widget.fit(None)
+        return_values = self.widget.parent.emit.call_args[0][1]
+        # Compare
+        self.assertItemsEqual(return_values[0], [1.0, 3.0])
+        self.assertAlmostEqual(return_values[1][0], 10.004054329, 6)
+        self.assertAlmostEqual(return_values[1][1], 12.030439848, 6)
+
+        # Set the log scale
+        self.widget.x_is_log = True
+        self.widget.fit(None)
+        return_values = self.widget.parent.emit.call_args[0][1]
+        # Compare
+        self.assertItemsEqual(return_values[0], [1.0, 3.0])
+        self.assertAlmostEqual(return_values[1][0], 9.987732937, 6)
+        self.assertAlmostEqual(return_values[1][1], 11.84365082, 6)
+
+    def testOrigData(self):
+        ''' Assure the un-logged data is returned'''
+        # log(x), log(y)
+        self.widget.xminFit, self.widget.xmaxFit = self.widget.range()
+        orig_x = [ 1.,  2.,  3.]
+        orig_y = [1.0, 1.0413926851582251, 1.0791812460476249]
+        orig_dy = [0.01, 0.018181818181818184, 0.024999999999999998]
+        x, y, dy = self.widget.origData()
+
+        self.assertItemsEqual(x, orig_x)
+        self.assertEqual(y[0], orig_y[0])
+        self.assertAlmostEqual(y[1], orig_y[1], 8)
+        self.assertAlmostEqual(y[2], orig_y[2], 8)
+        self.assertEqual(dy[0], orig_dy[0])
+        self.assertAlmostEqual(dy[1], orig_dy[1], 8)
+        self.assertAlmostEqual(dy[2], orig_dy[2], 8)
+
+        # x, y
+        self.widget.x_is_log = False
+        self.widget.y_is_log = False
+        self.widget.xminFit, self.widget.xmaxFit = self.widget.range()
+        orig_x = [ 1.,  2.,  3.]
+        orig_y = [10., 11., 12.]
+        orig_dy = [0.1, 0.2, 0.3]
+        x, y, dy = self.widget.origData()
+
+        self.assertItemsEqual(x, orig_x)
+        self.assertItemsEqual(y, orig_y)
+        self.assertItemsEqual(dy, orig_dy)
+
+        # x, log(y)
+        self.widget.x_is_log = False
+        self.widget.y_is_log = True
+        self.widget.xminFit, self.widget.xmaxFit = self.widget.range()
+        orig_x = [ 1.,  2.,  3.]
+        orig_y = [1.0, 1.0413926851582251, 1.0791812460476249]
+        orig_dy = [0.01, 0.018181818181818184, 0.024999999999999998]
+        x, y, dy = self.widget.origData()
+
+        self.assertItemsEqual(x, orig_x)
+        self.assertEqual(y[0], orig_y[0])
+        self.assertAlmostEqual(y[1], orig_y[1], 8)
+        self.assertAlmostEqual(y[2], orig_y[2], 8)
+        self.assertEqual(dy[0], orig_dy[0])
+        self.assertAlmostEqual(dy[1], orig_dy[1], 8)
+        self.assertAlmostEqual(dy[2], orig_dy[2], 8)
+
+    def testCheckFitValues(self):
+        '''Assure fit values are correct'''
+        # Good values
+        self.assertTrue(self.widget.checkFitValues(self.widget.txtFitRangeMin))
+        # Colors platform dependent
+        #self.assertEqual(self.widget.txtFitRangeMin.palette().color(10).name(), "#f0f0f0")
+        # Bad values
+        self.widget.x_is_log = True
+        self.widget.txtFitRangeMin.setText("-1.0")
+        self.assertFalse(self.widget.checkFitValues(self.widget.txtFitRangeMin))
+       
+
+    def testFloatInvTransform(self):
+        '''Test the helper method for providing conversion function'''
+        self.widget.xLabel="x"
+        self.assertEqual(self.widget.floatInvTransform(5.0), 5.0)
+        self.widget.xLabel="x^(2)"
+        self.assertEqual(self.widget.floatInvTransform(25.0), 5.0)
+        self.widget.xLabel="x^(4)"
+        self.assertEqual(self.widget.floatInvTransform(81.0), 3.0)
+        self.widget.xLabel="log10(x)"
+        self.assertEqual(self.widget.floatInvTransform(2.0), 100.0)
+        self.widget.xLabel="ln(x)"
+        self.assertEqual(self.widget.floatInvTransform(1.0), numpy.exp(1))
+        self.widget.xLabel="log10(x^(4))"
+        self.assertEqual(self.widget.floatInvTransform(4.0), 10.0)
+      
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/PlotHelperTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/PlotHelperTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/PlotHelperTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,54 @@
+import unittest
+
+# Tested module
+import sas.qtgui.Plotting.PlotHelper as PlotHelper
+
+class PlotHelperTest(unittest.TestCase):
+    '''Test the Plot helper functions'''
+    def setUp(self):
+        '''Empty'''
+        pass
+
+    def tearDown(self):
+        '''Empty'''
+        pass
+
+    def testDefaults(self):
+        """ default method variables values """
+        self.assertIsInstance(PlotHelper._plots, dict)
+        self.assertEqual(PlotHelper._plots, {})
+        self.assertEqual(PlotHelper._plot_id, 0)
+
+    def testFunctions(self):
+        """ Adding a plot """
+        plot = "I am a plot. Really."
+        PlotHelper.addPlot(plot)
+        plot_id = PlotHelper.idOfPlot(plot)
+
+        # We can't guarantee unique values for plot_id, as
+        # the tests are executed in random order, so just
+        # make sure we get consecutive values for 2 plots
+        plot2 = "I am also a plot."
+        PlotHelper.addPlot(plot2)
+        plot_id_2 = PlotHelper.idOfPlot(plot2)
+        id1 = int(plot_id[-1])
+        id2 = int(plot_id_2[-1])
+        self.assertEqual(id2 - id1, 1)
+
+        # Other properties
+        #self.assertEqual(PlotHelper.currentPlots(), [plot_id, plot_id_2])
+        self.assertTrue(set(PlotHelper.currentPlots()).issubset([plot_id, plot_id_2]))
+        self.assertEqual(PlotHelper.plotById(plot_id), plot)
+        self.assertEqual(PlotHelper.plotById(plot_id_2), plot2)
+
+        # Delete a graph
+        PlotHelper.deletePlot(plot_id)
+        self.assertEqual(PlotHelper.currentPlots(), [plot_id_2])
+
+        # Add another graph to see the counter
+        plot3 = "Just another plot. Move along."
+        PlotHelper.addPlot(plot3)
+        #self.assertEqual(PlotHelper.idOfPlot(plot3), plot_id_2 + 1)
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,102 @@
+import sys
+import unittest
+from mock import MagicMock
+
+from PyQt4 import QtGui
+
+# set up import paths
+import path_prepare
+
+# Local
+from sas.qtgui.Plotting.PlotProperties import PlotProperties
+
+app = QtGui.QApplication(sys.argv)
+
+class PlotPropertiesTest(unittest.TestCase):
+    '''Test the PlotProperties'''
+    def setUp(self):
+        '''Create the PlotProperties'''
+
+        self.widget = PlotProperties(None,
+                         color=1,
+                         marker=3,
+                         marker_size=10,
+                         legend="LL")
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+        self.assertEqual(self.widget.windowTitle(), "Modify Plot Properties")
+
+        # Check the combo boxes
+        self.assertEqual(self.widget.cbColor.currentText(), "Green")
+        self.assertEqual(self.widget.cbColor.count(), 7)
+        self.assertEqual(self.widget.cbShape.currentText(), "Triangle Down")
+        self.assertEqual(self.widget.txtLegend.text(), "LL")
+        self.assertEqual(self.widget.sbSize.value(), 10)
+
+    def testDefaultsWithCustomColor(self):
+        '''Test the GUI when called with custom color'''
+        widget = PlotProperties(None,
+                         color="#FF00FF",
+                         marker=7,
+                         marker_size=10,
+                         legend="LL")
+
+        self.assertEqual(widget.cbColor.currentText(), "Custom")
+        self.assertEqual(widget.cbColor.count(), 8)
+        
+    def testOnColorChange(self):
+        '''Test the response to color change event'''
+        # Accept the new color
+        QtGui.QColorDialog.getColor = MagicMock(return_value=QtGui.QColor(255, 0, 255))
+
+        self.widget.onColorChange()
+
+        self.assertEqual(self.widget.color(), "#ff00ff")
+        self.assertTrue(self.widget.custom_color)
+        self.assertEqual(self.widget.cbColor.currentIndex(), 7)
+        self.assertEqual(self.widget.cbColor.currentText(), "Custom")
+
+        # Reset the color - this will remove "Custom" from the combobox
+        # and set its index to "Green"
+        self.widget.cbColor.setCurrentIndex(1)
+        self.assertEqual(self.widget.cbColor.currentText(), "Green")
+
+        # Cancel the dialog now
+        bad_color = QtGui.QColor() # constructs an invalid color
+        QtGui.QColorDialog.getColor = MagicMock(return_value=bad_color)
+        self.widget.onColorChange()
+
+        self.assertEqual(self.widget.color(), 1)
+        self.assertFalse(self.widget.custom_color)
+        self.assertEqual(self.widget.cbColor.currentIndex(), 1)
+        self.assertEqual(self.widget.cbColor.currentText(), "Green")
+
+
+    def testOnColorIndexChange(self):
+        '''Test the response to color index change event'''
+        # Intitial population of the color combo box
+        self.widget.onColorIndexChange()
+        self.assertEqual(self.widget.cbColor.count(), 7)
+        # Block the callback so we can update the cb
+        self.widget.cbColor.blockSignals(True)
+        # Add the Custom entry
+        self.widget.cbColor.addItems(["Custom"])
+        # Unblock the callback
+        self.widget.cbColor.blockSignals(False)
+        # Assert the new CB
+        self.assertEqual(self.widget.cbColor.count(), 8)
+        # Call the method
+        self.widget.onColorIndexChange()
+        # see that the Custom entry disappeared
+        self.assertEqual(self.widget.cbColor.count(), 7)
+        self.assertEqual(self.widget.cbColor.findText("Custom"), -1)
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/PlotUtilitiesTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/PlotUtilitiesTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/PlotUtilitiesTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,46 @@
+import sys
+import unittest
+from collections import OrderedDict
+
+from UnitTesting.TestUtils import WarningTestNotImplemented
+
+# Tested module
+import sas.qtgui.Plotting.PlotUtilities as PlotUtilities
+
+class PlotUtilitiesTest(unittest.TestCase):
+    '''Test the Plot Utilities functions'''
+    def setUp(self):
+        '''Empty'''
+        pass
+
+    def tearDown(self):
+        '''Empty'''
+        pass
+
+    def testDefaults(self):
+        """ default method variables values """
+        self.assertIsInstance(PlotUtilities.SHAPES, OrderedDict)
+        self.assertIsInstance(PlotUtilities.COLORS, OrderedDict)
+
+    def testBuildMatrix(self):
+        """ build matrix for 2d plot from a vector """
+        WarningTestNotImplemented()
+
+    def testGetBins(self):
+        """ test 1d arrays of the index with square binning """
+        WarningTestNotImplemented()
+
+    def testFillupPixels(self):
+        """ test filling z values of the empty cells of 2d image matrix """
+        WarningTestNotImplemented()
+
+    def testRescale(sef):
+        """ test the helper function for step based zooming """
+        WarningTestNotImplemented()
+
+    def testGgetValidColor(self):
+        """ test that the method returns a color understood by MPL """
+        WarningTestNotImplemented()
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,238 @@
+import sys
+import unittest
+import numpy
+
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+from mock import MagicMock
+from mpl_toolkits.mplot3d import Axes3D
+
+####### TEMP
+import path_prepare
+#######
+from sas.sasgui.guiframe.dataFitting import Data1D
+from sas.sasgui.guiframe.dataFitting import Data2D
+from UnitTesting.TestUtils import WarningTestNotImplemented
+
+# Tested module
+import sas.qtgui.Plotting.Plotter2D as Plotter2D
+
+app = QtGui.QApplication(sys.argv)
+
+class Plotter2DTest(unittest.TestCase):
+    '''Test the Plotter 2D class'''
+    def setUp(self):
+        '''create'''
+        class dummy_manager(object):
+            def communicator(self):
+                return Communicate()
+            def perspective(self):
+                return MyPerspective()
+            def workspace(self):
+                return None
+
+        self.plotter = Plotter2D.Plotter2D(parent=dummy_manager(), quickplot=True)
+
+        self.data = Data2D(image=[0.1]*4,
+                           qx_data=[1.0, 2.0, 3.0, 4.0],
+                           qy_data=[10.0, 11.0, 12.0, 13.0],
+                           dqx_data=[0.1, 0.2, 0.3, 0.4],
+                           dqy_data=[0.1, 0.2, 0.3, 0.4],
+                           q_data=[1,2,3,4],
+                           xmin=-1.0, xmax=5.0,
+                           ymin=-1.0, ymax=15.0,
+                           zmin=-1.0, zmax=20.0)
+
+        self.data.title="Test data"
+        self.data.id = 1
+
+    def tearDown(self):
+        '''destroy'''
+        self.plotter = None
+
+    def testDataProperty(self):
+        """ Adding data """
+        self.plotter.data = self.data
+
+        self.assertEqual(self.plotter.data, self.data)
+        self.assertEqual(self.plotter._title, self.data.title)
+        self.assertEqual(self.plotter.xLabel, "$\\rm{Q_{x}}(A^{-1})$")
+        self.assertEqual(self.plotter.yLabel, "$\\rm{Q_{y}}(A^{-1})$")
+
+    def testPlot(self):
+        """ Look at the plotting """
+        self.plotter.data = self.data
+        self.plotter.show()
+        FigureCanvas.draw_idle = MagicMock()
+
+        self.plotter.plot()
+
+        self.assertTrue(FigureCanvas.draw_idle.called)
+
+    def testCalculateDepth(self):
+        ''' Test the depth calculator '''
+        self.plotter.data = self.data
+
+        # Default, log scale
+        depth = self.plotter.calculateDepth()
+        self.assertEqual(depth, (0.1, 1.e20))
+
+        # Change the scale to linear
+        self.plotter.scale = 'linear'
+        depth = self.plotter.calculateDepth()
+        self.assertEqual(depth[0], -32.)
+        self.assertAlmostEqual(depth[1], 1.30103, 5)
+
+    def testOnColorMap(self):
+        ''' Respond to the color map event '''
+        self.plotter.data = self.data
+        self.plotter.plot()
+        self.plotter.show()
+
+        QtGui.QDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Accepted)
+
+        # Just this one plot
+        self.plotter.onColorMap()
+
+        # Check that exec_ got called
+        self.assertTrue(QtGui.QDialog.exec_.called)
+
+        self.assertEqual(self.plotter.cmap, "jet")
+        self.assertAlmostEqual(self.plotter.vmin, 0.1, 6)
+        self.assertAlmostEqual(self.plotter.vmax, 1e+20, 6)
+
+    def testOnToggleScale(self):
+        """ Respond to the event by replotting """
+        self.plotter.data = self.data
+        self.plotter.show()
+        FigureCanvas.draw_idle = MagicMock()
+
+        self.plotter.onToggleScale(None)
+
+        self.assertTrue(FigureCanvas.draw_idle.called)
+
+    def testOnBoxSum(self):
+        """ Test the box sum display and functionality """
+
+        # hacky way to make things work in manipulations._sum
+        self.data.detector = [1]
+        self.data.err_data = numpy.array([0.0, 0.0, 0.1, 0.0])
+        self.plotter.data = self.data
+        self.plotter.show()
+
+        # Mock the main window
+        self.plotter.manager.parent = MagicMock()
+
+        # Call the main tested method
+        self.plotter.onBoxSum()
+
+        # Test various properties
+        self.assertIsInstance(self.plotter.slicer.model(), QtGui.QStandardItemModel)
+        self.assertTrue(self.plotter.boxwidget.isVisible())
+        self.assertIsInstance(self.plotter.boxwidget.model, QtGui.QStandardItemModel)
+
+    def testContextMenuQuickPlot(self):
+        """ Test the right click menu """
+        self.plotter.data = self.data
+        self.plotter.createContextMenuQuick()
+        actions = self.plotter.contextMenu.actions()
+        self.assertEqual(len(actions), 7)
+
+        # Trigger Save Image and make sure the method is called
+        self.assertEqual(actions[0].text(), "Save Image")
+        self.plotter.toolbar.save_figure = MagicMock()
+        actions[0].trigger()
+        self.assertTrue(self.plotter.toolbar.save_figure.called)
+
+        # Trigger Print Image and make sure the method is called
+        self.assertEqual(actions[1].text(), "Print Image")
+        QtGui.QPrintDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected)
+        actions[1].trigger()
+        self.assertTrue(QtGui.QPrintDialog.exec_.called)
+
+        # Trigger Copy to Clipboard and make sure the method is called
+        self.assertEqual(actions[2].text(), "Copy to Clipboard")
+
+        # Spy on cliboard's dataChanged() signal
+        self.clipboard_called = False
+        def done():
+            self.clipboard_called = True
+        QtCore.QObject.connect(app.clipboard(), QtCore.SIGNAL("dataChanged()"), done)
+        actions[2].trigger()
+        QtGui.qApp.processEvents()
+        # Make sure clipboard got updated.
+        #self.assertTrue(self.clipboard_called)
+
+        # Trigger Toggle Grid and make sure the method is called
+        self.assertEqual(actions[4].text(), "Toggle Grid On/Off")
+        self.plotter.ax.grid = MagicMock()
+        actions[4].trigger()
+        self.assertTrue(self.plotter.ax.grid.called)
+
+        # Trigger Change Scale and make sure the method is called
+        self.assertEqual(actions[6].text(), "Toggle Linear/Log Scale")
+        FigureCanvas.draw_idle = MagicMock()
+        actions[6].trigger()
+        self.assertTrue(FigureCanvas.draw_idle.called)
+
+    def testShowNoPlot(self):
+        """ Test the plot rendering and generation """
+
+        FigureCanvas.draw_idle = MagicMock()
+        FigureCanvas.draw = MagicMock()
+
+        # Test early return on no data
+        self.plotter.showPlot(data=None,
+                              qx_data=self.data.qx_data,
+                              qy_data=self.data.qy_data,
+                              xmin=self.data.xmin,
+                              xmax=self.data.xmax,
+                              ymin=self.data.ymin, ymax=self.data.ymax,
+                              cmap=None, zmin=None,
+                              zmax=None)
+
+        self.assertFalse(FigureCanvas.draw_idle.called)
+        self.assertFalse(FigureCanvas.draw.called)
+
+    def testShow3DPlot(self):
+        """ Test the 3Dplot rendering and generation """
+        # Test 3D printout
+        FigureCanvas.draw = MagicMock()
+        Axes3D.plot_surface = MagicMock()
+        self.plotter.figure.colorbar = MagicMock()
+
+        self.plotter.dimension = 3
+        self.plotter.data = self.data
+        self.plotter.showPlot(data=self.plotter.data.data,
+                              qx_data=self.data.qx_data,
+                              qy_data=self.data.qy_data,
+                              xmin=self.data.xmin,
+                              xmax=self.data.xmax,
+                              ymin=self.data.ymin, ymax=self.data.ymax,
+                              cmap=None, zmin=None,
+                              zmax=None)
+        self.assertTrue(Axes3D.plot_surface.called)
+        self.assertTrue(FigureCanvas.draw.called)
+
+    def testShow2DPlot(self):
+        """ Test the 2Dplot rendering and generation """
+        # Test 2D printout
+        FigureCanvas.draw_idle = MagicMock()
+        self.plotter.figure.colorbar = MagicMock()
+
+        self.plotter.dimension = 2
+        self.plotter.data = self.data
+        self.plotter.showPlot(data=self.plotter.data.data,
+                              qx_data=self.data.qx_data,
+                              qy_data=self.data.qy_data,
+                              xmin=self.data.xmin,
+                              xmax=self.data.xmax,
+                              ymin=self.data.ymin, ymax=self.data.ymax,
+                              cmap=None, zmin=None,
+                              zmax=None)
+        self.assertTrue(FigureCanvas.draw_idle.called)
+
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,194 @@
+import sys
+import unittest
+from mock import patch, MagicMock
+
+from PyQt4 import QtGui
+import matplotlib.pyplot as plt
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
+
+####### TEMP
+import path_prepare
+#######
+
+from sas.qtgui.Plotting.ScaleProperties import ScaleProperties
+from sas.qtgui.Plotting.WindowTitle import WindowTitle
+#import sas.qtgui.GuiUtils as GuiUtils
+from sas.qtgui.Utilities.GuiUtils import *
+import sas.qtgui.Plotting.PlotHelper as PlotHelper
+
+# Tested module
+import sas.qtgui.Plotting.PlotterBase as PlotterBase
+
+app = QtGui.QApplication(sys.argv)
+
+class PlotterBaseTest(unittest.TestCase):
+    '''Test the Plotter base class'''
+    def setUp(self):
+        '''create'''
+        class dummy_manager(object):
+            def communicator(self):
+                return Communicate()
+            def perspective(self):
+                return MyPerspective()
+
+        #PlotterBase.PlotterBase.contextMenuQuickPlot = MagicMock()
+        self.plotter = PlotterBase.PlotterBase(None, manager=dummy_manager(), quickplot=True)
+
+    def tearDown(self):
+        '''destroy'''
+        self.plotter = None
+        self.plotter_qp = None
+
+    def testDefaults(self):
+        """ default method variables values """
+        self.assertIsInstance(self.plotter, QtGui.QWidget)
+        self.assertIsInstance(self.plotter.canvas, FigureCanvas)
+        self.assertIsInstance(self.plotter.toolbar, NavigationToolbar)
+        self.assertIsInstance(self.plotter.properties, ScaleProperties)
+
+        self.assertEqual(self.plotter._data, [])
+        self.assertEqual(self.plotter._xscale, 'log')
+        self.assertEqual(self.plotter._yscale, 'log')
+        self.assertEqual(self.plotter.scale, 'linear')
+        self.assertFalse(self.plotter.grid_on)
+        self.assertEqual(self.plotter.x_label, 'log10(x)')
+        self.assertEqual(self.plotter.y_label, 'log10(y)')
+
+    def testData(self):
+        ''' Test the pure virtual method '''
+        with self.assertRaises(NotImplementedError):
+            self.plotter.data=[]
+
+    def testContextMenu(self):
+        ''' Test the default context menu '''
+        with self.assertRaises(NotImplementedError):
+            self.plotter.createContextMenu()
+
+    def testClean(self):
+        ''' test the graph cleanup '''
+        self.plotter.figure.delaxes = MagicMock()
+        self.plotter.clean()
+        self.assertTrue(self.plotter.figure.delaxes.called)
+
+    def testPlot(self):
+        ''' test the pure virtual method '''
+        with self.assertRaises(NotImplementedError):
+            self.plotter.plot()
+
+    def notestOnCloseEvent(self):
+        ''' test the plotter close behaviour '''
+        PlotHelper.deletePlot = MagicMock()
+        self.plotter.closeEvent(None)
+        self.assertTrue(PlotHelper.deletePlot.called)
+
+    def testOnImageSave(self):
+        ''' test the workspace save '''
+        self.plotter.toolbar.save_figure = MagicMock()
+        self.plotter.onImageSave()
+        self.assertTrue(self.plotter.toolbar.save_figure.called)
+
+    def testOnImagePrint(self):
+        ''' test the workspace print '''
+        QtGui.QPainter.end = MagicMock()
+        QtGui.QLabel.render = MagicMock()
+
+        # First, let's cancel printing
+        QtGui.QPrintDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected)
+        self.plotter.onImagePrint()
+        self.assertFalse(QtGui.QPainter.end.called)
+        self.assertFalse(QtGui.QLabel.render.called)
+
+        # Let's print now
+        QtGui.QPrintDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Accepted)
+        self.plotter.onImagePrint()
+        self.assertTrue(QtGui.QPainter.end.called)
+        self.assertTrue(QtGui.QLabel.render.called)
+
+    def testOnClipboardCopy(self):
+        ''' test the workspace screen copy '''
+        QtGui.QClipboard.setPixmap = MagicMock()
+        self.plotter.onClipboardCopy()
+        self.assertTrue(QtGui.QClipboard.setPixmap.called)
+
+    def testOnGridToggle(self):
+        ''' test toggling the grid lines '''
+        # Check the toggle
+        orig_toggle = self.plotter.grid_on
+        
+        FigureCanvas.draw_idle = MagicMock()
+        self.plotter.onGridToggle()
+
+        self.assertTrue(FigureCanvas.draw_idle.called)
+        self.assertTrue(self.plotter.grid_on != orig_toggle)
+
+    def testDefaultContextMenu(self):
+        """ Test the right click default menu """
+
+        self.plotter.defaultContextMenu()
+
+        actions = self.plotter.contextMenu.actions()
+        self.assertEqual(len(actions), 4)
+
+        # Trigger Save Image and make sure the method is called
+        self.assertEqual(actions[0].text(), "Save Image")
+        self.plotter.toolbar.save_figure = MagicMock()
+        actions[0].trigger()
+        self.assertTrue(self.plotter.toolbar.save_figure.called)
+
+        # Trigger Print Image and make sure the method is called
+        self.assertEqual(actions[1].text(), "Print Image")
+        QtGui.QPrintDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected)
+        actions[1].trigger()
+        self.assertTrue(QtGui.QPrintDialog.exec_.called)
+
+        # Trigger Copy to Clipboard and make sure the method is called
+        self.assertEqual(actions[2].text(), "Copy to Clipboard")
+
+        # Spy on cliboard's dataChanged() signal
+        self.clipboard_called = False
+        def done():
+            self.clipboard_called = True
+        QtCore.QObject.connect(app.clipboard(), QtCore.SIGNAL("dataChanged()"), done)
+        actions[2].trigger()
+        QtGui.qApp.processEvents()
+        # Make sure clipboard got updated.
+        self.assertTrue(self.clipboard_called)
+
+    def testOnWindowsTitle(self):
+        """ Test changing the plot title"""
+        # Mock the modal dialog's response
+        QtGui.QDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Accepted)
+        self.plotter.show()
+        # Assure the original title is none
+        self.assertEqual(self.plotter.windowTitle(), "")
+        self.plotter.manager.communicator = MagicMock()
+
+        WindowTitle.title = MagicMock(return_value="I am a new title")
+        # Change the title
+        self.plotter.onWindowsTitle()
+
+        self.assertEqual(self.plotter.windowTitle(), "I am a new title")
+
+    def testOnMplMouseDown(self):
+        """ Test what happens on mouse click down in chart """
+        pass
+
+    def testOnMplMouseUp(self):
+        """ Test what happens on mouse release in chart """
+        pass
+
+    def testOnMplMouseMotion(self):
+        """ Test what happens on mouse move in chart """
+        pass
+
+    def testOnMplPick(self):
+        """ Test what happens on mouse pick in chart """
+        pass
+
+    def testOnMplWheel(self):
+        """ Test what happens on mouse pick in chart """
+        pass
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,412 @@
+import sys
+import unittest
+
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+from mock import MagicMock
+from mock import patch
+
+####### TEMP
+import path_prepare
+#######
+from sas.sasgui.guiframe.dataFitting import Data1D
+from sas.sasgui.guiframe.dataFitting import Data2D
+from UnitTesting.TestUtils import WarningTestNotImplemented
+from sas.qtgui.Plotting.LinearFit import LinearFit
+from sas.qtgui.Plotting.PlotProperties import PlotProperties
+
+# Tested module
+import sas.qtgui.Plotting.Plotter as Plotter
+
+app = QtGui.QApplication(sys.argv)
+
+
+class PlotterTest(unittest.TestCase):
+    '''Test the Plotter 1D class'''
+    def setUp(self):
+        '''create'''
+
+        self.plotter = Plotter.Plotter(None, quickplot=True)
+        self.data = Data1D(x=[1.0, 2.0, 3.0],
+                           y=[10.0, 11.0, 12.0],
+                           dx=[0.1, 0.2, 0.3],
+                           dy=[0.1, 0.2, 0.3])
+        self.data.title="Test data"
+        self.data.name="Test name"
+        self.data.id = 1
+
+    def tearDown(self):
+        '''destroy'''
+        self.plotter = None
+
+    def testDataProperty(self):
+        """ Adding data """
+        self.plotter.data = self.data
+
+        self.assertEqual(self.plotter.data, self.data)
+        self.assertEqual(self.plotter._title, self.data.name)
+        self.assertEqual(self.plotter.xLabel, "$()$")
+        self.assertEqual(self.plotter.yLabel, "$()$")
+
+    def testPlotWithErrors(self):
+        """ Look at the plotting with error bars"""
+        self.plotter.data = self.data
+        self.plotter.show()
+        FigureCanvas.draw = MagicMock()
+
+        self.plotter.plot(hide_error=False)
+
+        self.assertEqual(self.plotter.ax.get_xscale(), 'log')
+        self.assertTrue(FigureCanvas.draw.called)
+
+    def testPlotWithoutErrors(self):
+        """ Look at the plotting without error bars"""
+        self.plotter.data = self.data
+        self.plotter.show()
+        FigureCanvas.draw = MagicMock()
+
+        self.plotter.plot(hide_error=True)
+
+        self.assertEqual(self.plotter.ax.get_yscale(), 'log')
+        self.assertTrue(FigureCanvas.draw.called)
+
+    def testCreateContextMenuQuick(self):
+        """ Test the right click menu """
+        self.plotter.createContextMenuQuick()
+        actions = self.plotter.contextMenu.actions()
+        self.assertEqual(len(actions), 7)
+
+        # Trigger Save Image and make sure the method is called
+        self.assertEqual(actions[0].text(), "Save Image")
+        self.plotter.toolbar.save_figure = MagicMock()
+        actions[0].trigger()
+        self.assertTrue(self.plotter.toolbar.save_figure.called)
+
+        # Trigger Print Image and make sure the method is called
+        self.assertEqual(actions[1].text(), "Print Image")
+        QtGui.QPrintDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected)
+        actions[1].trigger()
+        self.assertTrue(QtGui.QPrintDialog.exec_.called)
+
+        # Trigger Copy to Clipboard and make sure the method is called
+        self.assertEqual(actions[2].text(), "Copy to Clipboard")
+
+        # Spy on cliboard's dataChanged() signal
+        self.clipboard_called = False
+        def done():
+            self.clipboard_called = True
+        QtCore.QObject.connect(app.clipboard(), QtCore.SIGNAL("dataChanged()"), done)
+        actions[2].trigger()
+        QtGui.qApp.processEvents()
+        # Make sure clipboard got updated.
+        #self.assertTrue(self.clipboard_called)
+
+        # Trigger Toggle Grid and make sure the method is called
+        self.assertEqual(actions[4].text(), "Toggle Grid On/Off")
+        self.plotter.ax.grid = MagicMock()
+        actions[4].trigger()
+        self.assertTrue(self.plotter.ax.grid.called)
+
+        # Trigger Change Scale and make sure the method is called
+        self.assertEqual(actions[6].text(), "Change Scale")
+        self.plotter.properties.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected)
+        actions[6].trigger()
+        self.assertTrue(self.plotter.properties.exec_.called)
+
+    def testXyTransform(self):
+        """ Tests the XY transformation and new chart update """
+        self.plotter.plot(self.data)
+
+        # Transform the points
+        self.plotter.xyTransform(xLabel="x", yLabel="log10(y)")
+
+        # Assure new plot has correct labels
+        self.assertEqual(self.plotter.ax.get_xlabel(), "$()$")
+        self.assertEqual(self.plotter.ax.get_ylabel(), "$()$")
+        # ... and scale
+        self.assertEqual(self.plotter.xscale, "linear")
+        self.assertEqual(self.plotter.yscale, "log")
+        # See that just one plot is present
+        self.assertEqual(len(self.plotter.plot_dict), 1)
+        self.assertEqual(len(self.plotter.ax.collections), 1)
+
+    def testAddText(self):
+        """ Checks the functionality of adding text to graph """
+
+        self.plotter.plot(self.data)
+        self.plotter.x_click = 100.0
+        self.plotter.y_click = 100.0
+        # modify the text edit control
+        test_text = "Smoke in cabin"
+        test_font = QtGui.QFont("Arial", 16, QtGui.QFont.Bold)
+        test_color = "#00FF00"
+        self.plotter.addText.textEdit.setText(test_text)
+
+        # Return the requested font parameters
+        self.plotter.addText.font = MagicMock(return_value = test_font)
+        self.plotter.addText.color = MagicMock(return_value = test_color)
+        # Return OK from the dialog
+        self.plotter.addText.exec_ = MagicMock(return_value = QtGui.QDialog.Accepted)
+        # Add text to graph
+        self.plotter.onAddText()
+        self.plotter.show()
+        # Check if the text was added properly
+        self.assertEqual(len(self.plotter.textList), 1)
+        self.assertEqual(self.plotter.textList[0].get_text(), test_text)
+        self.assertEqual(self.plotter.textList[0].get_color(), test_color)
+        self.assertEqual(self.plotter.textList[0].get_fontproperties().get_family()[0], 'Arial')
+        self.assertEqual(self.plotter.textList[0].get_fontproperties().get_size(), 16)
+
+    def testOnRemoveText(self):
+        """ Cheks if annotations can be removed from the graph """
+
+        # Add some text
+        self.plotter.plot(self.data)
+        test_text = "Safety instructions"
+        self.plotter.addText.textEdit.setText(test_text)
+        # Return OK from the dialog
+        self.plotter.addText.exec_ = MagicMock(return_value = QtGui.QDialog.Accepted)
+        # Add text to graph
+        self.plotter.onAddText()
+        self.plotter.show()
+        # Check if the text was added properly
+        self.assertEqual(len(self.plotter.textList), 1)
+
+        # Now, remove the text
+        self.plotter.onRemoveText()
+
+        # And assure no text is displayed
+        self.assertEqual(self.plotter.textList, [])
+
+        # Attempt removal on empty and check
+        self.plotter.onRemoveText()
+        self.assertEqual(self.plotter.textList, [])
+
+    def testOnSetGraphRange(self):
+        """ Cheks if the graph can be resized for range """
+        new_x = (1,2)
+        new_y = (10,11)
+        self.plotter.plot(self.data)
+        self.plotter.show()
+        self.plotter.setRange.exec_ = MagicMock(return_value = QtGui.QDialog.Accepted)
+        self.plotter.setRange.xrange = MagicMock(return_value = new_x)
+        self.plotter.setRange.yrange = MagicMock(return_value = new_y)
+
+        # Call the tested method
+        self.plotter.onSetGraphRange()
+        # See that ranges changed accordingly
+        self.assertEqual(self.plotter.ax.get_xlim(), new_x)
+        self.assertEqual(self.plotter.ax.get_ylim(), new_y)
+
+    def testOnResetGraphRange(self):
+        """ Cheks if the graph can be reset after resizing for range """
+        # New values
+        new_x = (1,2)
+        new_y = (10,11)
+        # define the plot
+        self.plotter.plot(self.data)
+        self.plotter.show()
+
+        # mock setRange methods
+        self.plotter.setRange.exec_ = MagicMock(return_value = QtGui.QDialog.Accepted)
+        self.plotter.setRange.xrange = MagicMock(return_value = new_x)
+        self.plotter.setRange.yrange = MagicMock(return_value = new_y)
+
+        # Change the axes range
+        self.plotter.onSetGraphRange()
+
+        # Now, reset the range back
+        self.plotter.onResetGraphRange()
+
+        # See that ranges are changed
+        self.assertNotEqual(self.plotter.ax.get_xlim(), new_x)
+        self.assertNotEqual(self.plotter.ax.get_ylim(), new_y)
+
+    def testOnLinearFit(self):
+        """ Checks the response to LinearFit call """
+        self.plotter.plot(self.data)
+        self.plotter.show()
+        QtGui.QDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Accepted)
+
+        # Just this one plot
+        self.assertEqual(len(self.plotter.plot_dict.keys()), 1)
+        self.plotter.onLinearFit(1)
+
+        # Check that exec_ got called
+        self.assertTrue(QtGui.QDialog.exec_.called)
+
+    def testOnRemovePlot(self):
+        """ Assure plots get removed when requested """
+        # Add two plots
+        self.plotter.show()
+        self.plotter.plot(self.data)
+        data2 = Data1D(x=[1.0, 2.0, 3.0],
+                       y=[11.0, 12.0, 13.0],
+                       dx=[0.1, 0.2, 0.3],
+                       dy=[0.1, 0.2, 0.3])
+        data2.title="Test data 2"
+        data2.name="Test name 2"
+        data2.id = 2
+        self.plotter.plot(data2)
+
+        # Assure the plotter window is visible
+        #self.assertTrue(self.plotter.isVisible())
+
+        # Assure we have two sets
+        self.assertEqual(len(self.plotter.plot_dict.keys()), 2)
+
+        # Delete one set
+        self.plotter.onRemovePlot(2)
+        # Assure we have two sets
+        self.assertEqual(len(self.plotter.plot_dict.keys()), 1)
+
+        self.plotter.manager = MagicMock()
+
+        # Delete the remaining set
+        self.plotter.onRemovePlot(1)
+        # Assure we have no plots
+        self.assertEqual(len(self.plotter.plot_dict.keys()), 0)
+        # Assure the plotter window is closed
+        self.assertFalse(self.plotter.isVisible())
+
+
+    def testRemovePlot(self):
+        """ Test plot removal """
+        # Add two plots
+        self.plotter.show()
+        self.plotter.plot(self.data)
+        data2 = Data1D(x=[1.0, 2.0, 3.0],
+                       y=[11.0, 12.0, 13.0],
+                       dx=[0.1, 0.2, 0.3],
+                       dy=[0.1, 0.2, 0.3])
+        data2.title="Test data 2"
+        data2.name="Test name 2"
+        data2.id = 2
+        data2._xaxis = "XAXIS"
+        data2._xunit = "furlong*fortnight^{-1}"
+        data2._yaxis = "YAXIS"
+        data2._yunit = "cake"
+        data2.hide_error = True
+        self.plotter.plot(data2)
+
+        # delete plot 1
+        self.plotter.removePlot(1)
+
+        # See that the labels didn't change
+        xl = self.plotter.ax.xaxis.label.get_text()
+        yl = self.plotter.ax.yaxis.label.get_text()
+        self.assertEqual(xl, "$XAXIS(furlong*fortnight^{-1})$")
+        self.assertEqual(yl, "$YAXIS(cake)$")
+        # The hide_error flag should also remain
+        self.assertTrue(self.plotter.plot_dict[2].hide_error)
+
+    def testOnToggleHideError(self):
+        """ Test the error bar toggle on plots """
+        # Add two plots
+        self.plotter.show()
+        self.plotter.plot(self.data)
+        data2 = Data1D(x=[1.0, 2.0, 3.0],
+                       y=[11.0, 12.0, 13.0],
+                       dx=[0.1, 0.2, 0.3],
+                       dy=[0.1, 0.2, 0.3])
+        data2.title="Test data 2"
+        data2.name="Test name 2"
+        data2.id = 2
+        data2._xaxis = "XAXIS"
+        data2._xunit = "furlong*fortnight^{-1}"
+        data2._yaxis = "YAXIS"
+        data2._yunit = "cake"
+        error_status = True
+        data2.hide_error = error_status
+        self.plotter.plot(data2)
+
+        # Reverse the toggle
+        self.plotter.onToggleHideError(2)
+        # See that the labels didn't change
+        xl = self.plotter.ax.xaxis.label.get_text()
+        yl = self.plotter.ax.yaxis.label.get_text()
+        self.assertEqual(xl, "$XAXIS(furlong*fortnight^{-1})$")
+        self.assertEqual(yl, "$YAXIS(cake)$")
+        # The hide_error flag should toggle
+        self.assertEqual(self.plotter.plot_dict[2].hide_error, not error_status)
+
+    def testOnFitDisplay(self):
+        """ Test the fit line display on the chart """
+        self.assertIsInstance(self.plotter.fit_result, Data1D)
+        self.assertEqual(self.plotter.fit_result.symbol, 13)
+        self.assertEqual(self.plotter.fit_result.name, "Fit")
+
+        # fudge some init data
+        fit_data = [[0.0,0.0], [5.0,5.0]]
+        # Call the method
+        self.plotter.plot = MagicMock()
+        self.plotter.onFitDisplay(fit_data)
+        self.assertTrue(self.plotter.plot.called)
+        # Look at arguments passed to .plot()
+        self.plotter.plot.assert_called_with(data=self.plotter.fit_result,
+                                             hide_error=True, marker='-')
+
+    def testReplacePlot(self):
+        """ Test the plot refresh functionality """
+        # Add original data
+        self.plotter.show()
+        self.plotter.plot(self.data)
+        # See the default labels
+        xl = self.plotter.ax.xaxis.label.get_text()
+        yl = self.plotter.ax.yaxis.label.get_text()
+        self.assertEqual(xl, "$()$")
+        self.assertEqual(yl, "$()$")
+
+        # Prepare new data
+        data2 = Data1D(x=[1.0, 2.0, 3.0],
+                       y=[11.0, 12.0, 13.0],
+                       dx=[0.1, 0.2, 0.3],
+                       dy=[0.1, 0.2, 0.3])
+        data2.title="Test data 2"
+        data2.name="Test name 2"
+        data2.id = 2
+        data2._xaxis = "XAXIS"
+        data2._xunit = "furlong*fortnight^{-1}"
+        data2._yaxis = "YAXIS"
+        data2._yunit = "cake"
+        error_status = True
+        data2.hide_error = error_status
+
+        # Replace data in plot
+        self.plotter.replacePlot(1, data2)
+
+        # See that the labels changed
+        xl = self.plotter.ax.xaxis.label.get_text()
+        yl = self.plotter.ax.yaxis.label.get_text()
+        self.assertEqual(xl, "$XAXIS(furlong*fortnight^{-1})$")
+        self.assertEqual(yl, "$YAXIS(cake)$")
+        # The hide_error flag should be as set
+        self.assertEqual(self.plotter.plot_dict[2].hide_error, error_status)
+
+    def notestOnModifyPlot(self):
+        """ Test the functionality for changing plot properties """
+        # Prepare new data
+        data2 = Data1D(x=[1.0, 2.0, 3.0],
+                       y=[11.0, 12.0, 13.0],
+                       dx=[0.1, 0.2, 0.3],
+                       dy=[0.1, 0.2, 0.3])
+        data2.title="Test data 2"
+        data2.name="Test name 2"
+        data2.id = 2
+        data2.custom_color = None
+        data2.symbol = 1
+        data2.markersize = 11
+
+        self.plotter.plot(data2)
+
+        with patch('sas.qtgui.Plotting.PlotProperties.PlotProperties') as mock:
+            instance = mock.return_value
+            QtGui.QDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Accepted)
+            instance.symbol.return_value = 7
+
+            self.plotter.onModifyPlot(2)
+
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/ScalePropertiesTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/ScalePropertiesTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/ScalePropertiesTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,60 @@
+import sys
+import unittest
+
+from PyQt4 import QtGui
+
+# set up import paths
+import sas.qtgui.path_prepare
+
+# Local
+from sas.qtgui.Plotting.ScaleProperties import ScaleProperties
+
+app = QtGui.QApplication(sys.argv)
+
+class ScalePropertiesTest(unittest.TestCase):
+    '''Test the ScaleProperties'''
+    def setUp(self):
+        '''Create the ScaleProperties'''
+
+        self.widget = ScaleProperties(None)
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+        self.assertEqual(self.widget.windowTitle(), "Scale Properties")
+        self.assertEqual(self.widget.cbX.count(), 6)
+        self.assertEqual(self.widget.cbY.count(), 12)
+        self.assertEqual(self.widget.cbView.count(), 6)
+        
+    def testGetValues(self):
+        '''Test the values returned'''
+        self.assertEqual(self.widget.getValues(), ("x", "y"))
+        self.widget.cbX.setCurrentIndex(2)
+        self.widget.cbY.setCurrentIndex(4)
+        self.assertEqual(self.widget.getValues(), ("x^(4)", "y*x^(2)"))
+
+    def testSettingView(self):
+        '''Test various settings of view'''
+        self.widget.cbView.setCurrentIndex(1)
+        self.assertEqual(self.widget.getValues(), ("x", "y"))
+        self.widget.cbView.setCurrentIndex(5)
+        self.assertEqual(self.widget.getValues(), ("x", "y*x^(2)"))
+
+        # Assure the View combobox resets on the x index changes
+        self.assertNotEqual(self.widget.cbView.currentIndex(), 0)
+        self.widget.cbX.setCurrentIndex(2)
+        self.assertEqual(self.widget.cbView.currentIndex(), 0)
+
+        # Same for Y
+        self.widget.cbView.setCurrentIndex(6)
+        self.assertNotEqual(self.widget.cbView.currentIndex(), 0)
+        self.widget.cbY.setCurrentIndex(2)
+        self.assertEqual(self.widget.cbView.currentIndex(), 0)
+      
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/SetGraphRangeTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/SetGraphRangeTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/SetGraphRangeTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,56 @@
+import sys
+import unittest
+
+from PyQt4 import QtGui
+
+# set up import paths
+import sas.qtgui.path_prepare
+
+# Local
+from sas.qtgui.Plotting.SetGraphRange import SetGraphRange
+
+app = QtGui.QApplication(sys.argv)
+
+class SetGraphRangeTest(unittest.TestCase):
+    '''Test the SetGraphRange'''
+    def setUp(self):
+        '''Create the SetGraphRange'''
+
+        self.widget = SetGraphRange(None)
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+        self.assertEqual(self.widget.windowTitle(), "Set Graph Range")
+        self.assertIsInstance(self.widget.txtXmin, QtGui.QLineEdit)
+        self.assertIsInstance(self.widget.txtXmin.validator(), QtGui.QDoubleValidator)
+        
+    def testGoodRanges(self):
+        '''Test the X range values set by caller''' 
+        self.assertEqual(self.widget.xrange(), (0.0, 0.0))
+        self.assertEqual(self.widget.yrange(), (0.0, 0.0))
+
+        new_widget = SetGraphRange(None, ("1.0", 2.0), (8.0, "-2"))
+        self.assertEqual(new_widget.xrange(), (1.0, 2.0))
+        self.assertEqual(new_widget.yrange(), (8.0, -2.0))
+
+
+    def testBadRanges(self):
+        '''Test the incorrect X range values set by caller'''
+        with self.assertRaises(ValueError):
+            new_widget = SetGraphRange(None, ("1.0", "aa"), (None, "@"))
+            self.assertEqual(new_widget.xrange(), (1.0, 0.0))
+            self.assertEqual(new_widget.yrange(), (0.0, 0.0))
+
+        with self.assertRaises(AssertionError):
+            new_widget = SetGraphRange(None, "I'm a tuple", None)
+            self.assertEqual(new_widget.xrange(), (1.0, 0.0))
+            self.assertEqual(new_widget.yrange(), (0.0, 0.0))
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/SlicerModelTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/SlicerModelTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/SlicerModelTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,77 @@
+import sys
+import unittest
+from mock import MagicMock
+
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+
+# set up import paths
+import sas.qtgui.path_prepare
+
+# Local
+from sas.qtgui.Plotting.SlicerModel import SlicerModel
+
+app = QtGui.QApplication(sys.argv)
+
+class SlicerModelTest(unittest.TestCase):
+    '''Test the SlicerModel'''
+    def setUp(self):
+        '''Create the SlicerModel'''
+        class SModel(SlicerModel):
+            params = {"a":1, "b":2}
+            def __init__(self):
+                SlicerModel.__init__(self)
+            def getParams(self):
+                return self.params
+            def setParams(self, par):
+                self.params = par
+        self.model = SModel()
+
+    def tearDown(self):
+        '''Destroy the model'''
+        self.model = None
+
+    def testBaseClass(self):
+        '''Assure that SlicerModel contains pure virtuals'''
+        model = SlicerModel()
+        with self.assertRaises(NotImplementedError):
+            model.setParams()
+        with self.assertRaises(NotImplementedError):
+            model.setModelFromParams()
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.assertIsInstance(self.model.model(), QtGui.QStandardItemModel)
+
+    def testSetModelFromParams(self):
+        '''Test the model update'''
+        # Add a row to params
+        new_dict = self.model.getParams()
+        new_dict["c"] = 3
+        self.model.setParams(new_dict)
+
+        # Call the update
+        self.model.setModelFromParams()
+
+        # Check the new model.
+        self.assertEqual(self.model.model().rowCount(), 3)
+        self.assertEqual(self.model.model().columnCount(), 2)
+
+    def testSetParamsFromModel(self):
+        ''' Test the parameters update'''
+        # First - the default model
+        self.model.setModelFromParams()
+        self.assertEqual(self.model.model().rowCount(), 2)
+        self.assertEqual(self.model.model().columnCount(), 2)
+
+        # Add a row
+        item1 = QtGui.QStandardItem("c")
+        item2 = QtGui.QStandardItem(3)
+        self.model.model().appendRow([item1, item2])
+        # Check the new model. The update should be automatic
+        self.assertEqual(self.model.model().rowCount(), 3)
+        self.assertEqual(self.model.model().columnCount(), 2)
+
+
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/SlicerParametersTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/SlicerParametersTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/SlicerParametersTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,110 @@
+import sys
+import unittest
+from mock import MagicMock
+
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+from PyQt4 import QtTest
+from PyQt4 import QtWebKit
+
+from mock import MagicMock
+
+# set up import paths
+import sas.qtgui.path_prepare
+
+from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy
+
+# Local
+from sas.qtgui.Plotting.SlicerParameters import SlicerParameters
+
+app = QtGui.QApplication(sys.argv)
+
+class SlicerParametersTest(unittest.TestCase):
+    '''Test the SlicerParameters dialog'''
+    def setUp(self):
+        '''Create the SlicerParameters dialog'''
+
+        item1 = QtGui.QStandardItem("dromekage")
+        item2 = QtGui.QStandardItem("999.0")
+        self.model = QtGui.QStandardItemModel()
+        self.model.appendRow([item1, item2])
+        self.widget = SlicerParameters(model=self.model)
+
+    def tearDown(self):
+        '''Destroy the model'''
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        #self.widget.mapper
+        self.assertIsInstance(self.widget.proxy, QtGui.QIdentityProxyModel)
+        self.assertIsInstance(self.widget.lstParams.itemDelegate(), QtGui.QStyledItemDelegate)
+        self.assertTrue(self.widget.lstParams.model().columnReadOnly(0))
+        self.assertFalse(self.widget.lstParams.model().columnReadOnly(1))
+
+        # Test the proxy model
+        self.assertEqual(self.widget.lstParams.model(), self.widget.proxy)
+        self.assertEqual(self.widget.proxy.columnCount(), 2)
+        self.assertEqual(self.widget.proxy.rowCount(), 1)
+        self.assertEqual(self.widget.model.item(0,0).text(), 'dromekage')
+        self.assertEqual(self.widget.model.item(0,1).text(), '999.0')
+
+        # Check the flags in the proxy model
+        flags = self.widget.proxy.flags(self.widget.proxy.index(0,0))
+        self.assertFalse(flags & QtCore.Qt.ItemIsEditable)
+        self.assertTrue(flags & QtCore.Qt.ItemIsSelectable)
+        self.assertTrue(flags & QtCore.Qt.ItemIsEnabled)
+
+    def testClose(self):
+        ''' Assure that clicking on Close triggers right behaviour'''
+        self.widget.show()
+
+        # Set up the spy
+        spy_close = QtSignalSpy(self.widget, self.widget.close_signal)
+        # Click on the "Close" button
+        QtTest.QTest.mouseClick(self.widget.buttonBox.button(QtGui.QDialogButtonBox.Close), QtCore.Qt.LeftButton)
+        # Check the signal
+        self.assertEqual(spy_close.count(), 1)
+        # Assure the window got closed
+        self.assertFalse(self.widget.isVisible())
+
+    def testOnHelp(self):
+        ''' Assure clicking on help returns QtWeb view on requested page'''
+        self.widget.show()
+
+        #Mock the QWebView method
+        QtWebKit.QWebView.show = MagicMock()
+        QtWebKit.QWebView.load = MagicMock()
+
+        # Invoke the action
+        self.widget.onHelp()
+
+        # Check if show() got called
+        self.assertTrue(QtWebKit.QWebView.show.called)
+
+        # Assure the filename is correct
+        self.assertIn("graph_help.html", QtWebKit.QWebView.load.call_args[0][0].toString())
+        
+    def testSetModel(self):
+        ''' Test if resetting the model works'''
+        
+        item1 = QtGui.QStandardItem("s1")
+        item2 = QtGui.QStandardItem("5.0")
+        new_model = QtGui.QStandardItemModel()
+        new_model.appendRow([item1, item2])
+        item1 = QtGui.QStandardItem("s2")
+        item2 = QtGui.QStandardItem("20.0")
+        new_model.appendRow([item1, item2])
+        # Force the new model onto the widget
+        self.widget.setModel(model=new_model)
+
+        # Test if the widget got it
+        self.assertEqual(self.widget.model.columnCount(), 2)
+        self.assertEqual(self.widget.model.rowCount(), 2)
+        self.assertEqual(self.widget.model.item(0,0).text(), 's1')
+        self.assertEqual(self.widget.model.item(1,0).text(), 's2')
+
+
+        
+if __name__ == "__main__":
+    unittest.main()
Index: src/sas/qtgui/Plotting/UnitTesting/WindowTitleTest.py
===================================================================
--- src/sas/qtgui/Plotting/UnitTesting/WindowTitleTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
+++ src/sas/qtgui/Plotting/UnitTesting/WindowTitleTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -0,0 +1,47 @@
+import sys
+import unittest
+
+from PyQt4 import QtGui
+
+# set up import paths
+import sas.qtgui.path_prepare
+
+# Local
+from sas.qtgui.Plotting.WindowTitle import WindowTitle
+
+app = QtGui.QApplication(sys.argv)
+
+class WindowTitleTest(unittest.TestCase):
+    '''Test the WindowTitle'''
+    def setUp(self):
+        '''Create the WindowTitle'''
+        self.widget = WindowTitle(None, new_title="some title")
+
+    def tearDown(self):
+        '''Destroy the GUI'''
+        self.widget.close()
+        self.widget = None
+
+    def testDefaults(self):
+        '''Test the GUI in its default state'''
+        self.widget.show()
+        self.assertIsInstance(self.widget, QtGui.QDialog)
+        self.assertEqual(self.widget.windowTitle(), "Modify Window Title")
+        
+    def testTitle(self):
+        '''Modify the title'''
+        self.widget.show()
+        app.processEvents()
+        # make sure we have the pre-set title
+        self.assertEqual(self.widget.txtTitle.text(), "some title")
+        # Clear the control and set it to something else
+        self.widget.txtTitle.clear()
+        self.widget.txtTitle.setText("5 elephants")
+        app.processEvents()
+        # Retrieve value
+        new_title = self.widget.title()
+        # Check
+        self.assertEqual(new_title, "5 elephants")
+       
+if __name__ == "__main__":
+    unittest.main()
