Index: src/sas/qtgui/UnitTesting/AboutBoxTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/AboutBoxTest.py	(revision 31c5b583d8c577c4ed72be87d22d34ec2ed50c04)
+++ 	(revision )
@@ -1,103 +1,0 @@
-import sys
-import unittest
-import webbrowser
-
-from PyQt4.QtGui import *
-from PyQt4.QtTest import QTest
-from PyQt4.QtCore import *
-from mock import MagicMock
-
-# set up import paths
-import path_prepare
-
-# Local
-from AboutBox import AboutBox
-import sas.qtgui.LocalConfig as LocalConfig
-
-app = QApplication(sys.argv)
-
-class AboutBoxTest(unittest.TestCase):
-    '''Test the AboutBox'''
-    def setUp(self):
-        '''Create the AboutBox'''
-        self.widget = AboutBox(None)
-
-    def tearDown(self):
-        '''Destroy the AboutBox'''
-        self.widget.close()
-        self.widget = None
-
-    def testDefaults(self):
-        '''Test the GUI in its default state'''
-        self.assertIsInstance(self.widget, QWidget)
-        self.assertEqual(self.widget.windowTitle(), "About")
-        self.assertEqual(self.widget.cmdOK.text(), "OK")
-
-        self.assertIn("SasView", self.widget.label_2.text())
-        # Link buttons pixmaps don't contain image filenames, so can't check this.
-        # self.assertEqual(self.widget.cmdLinkUT.icon().name(), "utlogo.gif")
-
-
-    def testVersion(self):
-        """
-        Assure the version number is as expected
-        """
-        version = self.widget.lblVersion
-        self.assertIsInstance(version, QLabel)
-        self.assertEqual(str(version.text()), str(LocalConfig.__version__))
-
-    def testAbout(self):
-        """
-        Assure the about label is filled properly
-        """
-        about = self.widget.lblAbout
-        self.assertIsInstance(about, QLabel)
-        # build version
-        self.assertIn(str(LocalConfig.__build__), about.text())
-        # License
-        self.assertIn(str(LocalConfig._copyright), about.text())
-        # URLs
-        self.assertIn(str(LocalConfig._homepage), about.text())
-        self.assertIn(str(LocalConfig.__download_page__), about.text())
-        self.assertIn(str(LocalConfig._license), about.text())
-
-        # Are links enabled?
-        self.assertTrue(about.openExternalLinks())
-
-    def testAddActions(self):
-        """
-        Assure link buttons are set up correctly
-        """
-        webbrowser.open = MagicMock()
-        all_hosts = [
-                LocalConfig._nist_url,
-                LocalConfig._umd_url,
-                LocalConfig._sns_url,
-                LocalConfig._nsf_url,
-                LocalConfig._isis_url,
-                LocalConfig._ess_url,
-                LocalConfig._ill_url,
-                LocalConfig._ansto_url,
-                LocalConfig._inst_url]
-
-        # Press the buttons
-        buttonList = self.widget.findChildren(QPushButton)
-        for button in buttonList:
-            QTest.mouseClick(button, Qt.LeftButton)
-            #open_link = webbrowser.open.call_args
-            args, _ = webbrowser.open.call_args
-            # args[0] contains the actual argument sent to open()
-            self.assertIn(args[0], all_hosts)
-
-        # The above test also greedily catches the OK button,
-        # so let's test it separately.
-        # Show the widget
-        self.widget.show()
-        self.assertTrue(self.widget.isVisible())
-        # Click on the OK button
-        QTest.mouseClick(self.widget.cmdOK, Qt.LeftButton)
-        # assure the widget is no longer seen
-        self.assertFalse(self.widget.isVisible())
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/AddTextTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/AddTextTest.py	(revision 9290b1a2e57458d51b13f1acd1798b999372c7d7)
+++ 	(revision )
@@ -1,61 +1,0 @@
-import sys
-import unittest
-from mock import MagicMock
-
-from PyQt4 import QtGui
-
-# set up import paths
-import path_prepare
-
-# Local
-from 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/UnitTesting/BoxSumTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/BoxSumTest.py	(revision 3bdbfcc5cdff8a3a11a9bb19c1cc8c3660a9c2e2)
+++ 	(revision )
@@ -1,47 +1,0 @@
-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 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/UnitTesting/ColorMapTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/ColorMapTest.py	(revision 5d89f43266c67cb96a7bf395800ce4cce896c9f8)
+++ 	(revision )
@@ -1,200 +1,0 @@
-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.Plotter2D as Plotter2D
-from UnitTesting.TestUtils import WarningTestNotImplemented
-from UnitTesting.TestUtils import QtSignalSpy
-
-# Local
-from sas.qtgui.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/UnitTesting/DataExplorerTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/DataExplorerTest.py	(revision 2155824bc3dcd6c0afe1204caa0357472cf9b060)
+++ 	(revision )
@@ -1,807 +1,0 @@
-import sys
-import unittest
-
-from PyQt4.QtGui import *
-from PyQt4.QtTest import QTest
-from PyQt4.QtCore import *
-from mock import MagicMock
-from mock import patch
-from mpl_toolkits.mplot3d import Axes3D
-
-# set up import paths
-import path_prepare
-
-# Local
-from sas.sasgui.guiframe.dataFitting import Data1D
-from sas.sascalc.dataloader.loader import Loader
-from sas.sasgui.guiframe.data_manager import DataManager
-
-from DataExplorer import DataExplorerWindow
-from GuiManager import GuiManager
-from sas.qtgui.GuiUtils import *
-from UnitTesting.TestUtils import QtSignalSpy
-from sas.qtgui.Plotter import Plotter
-from sas.qtgui.Plotter2D import Plotter2D
-import sas.qtgui.PlotHelper as PlotHelper
-
-app = QApplication(sys.argv)
-
-class DataExplorerTest(unittest.TestCase):
-    '''Test the Data Explorer GUI'''
-    def setUp(self):
-        '''Create the GUI'''
-        class MyPerspective(object):
-            def communicator(self):
-                return Communicate()
-            def allowBatch(self):
-                return False
-            def setData(self, data_item=None):
-                return None
-            def title(self):
-                return "Dummy Perspective"
-
-        class dummy_manager(object):
-            def communicator(self):
-                return Communicate()
-            def perspective(self):
-                return MyPerspective()
-            def workspace(self):
-                return None
-
-        self.form = DataExplorerWindow(None, dummy_manager())
-
-    def tearDown(self):
-        '''Destroy the GUI'''
-        self.form.close()
-        self.form = None
-
-    def testDefaults(self):
-        '''Test the GUI in its default state'''
-        # Tab widget
-        self.assertIsInstance(self.form, QTabWidget)
-        self.assertEqual(self.form.count(), 2)
-
-        # Buttons - data tab
-        self.assertEqual(self.form.cmdLoad.text(), "Load data")
-        self.assertEqual(self.form.cmdDeleteData.text(), "Delete")
-        self.assertEqual(self.form.cmdDeleteTheory.text(), "Delete")
-        self.assertEqual(self.form.cmdFreeze.text(), "Freeze Theory")
-        self.assertEqual(self.form.cmdSendTo.text(), "Send data to")
-        self.assertEqual(self.form.cmdSendTo.iconSize(), QSize(48, 48))
-        self.assertIsInstance(self.form.cmdSendTo.icon(), QIcon)
-        self.assertEqual(self.form.chkBatch.text(), "Batch mode")
-        self.assertFalse(self.form.chkBatch.isChecked())
-
-        # Buttons - theory tab
-
-        # Combo boxes
-        self.assertEqual(self.form.cbSelect.count(), 6)
-        self.assertEqual(self.form.cbSelect.currentIndex(), 0)
-
-        # Models - data
-        self.assertIsInstance(self.form.model, QStandardItemModel)
-        self.assertEqual(self.form.treeView.model().rowCount(), 0)
-        self.assertEqual(self.form.treeView.model().columnCount(), 0)
-        self.assertEqual(self.form.model.rowCount(), 0)
-        self.assertEqual(self.form.model.columnCount(), 0)
-        self.assertIsInstance(self.form.data_proxy, QSortFilterProxyModel)
-        self.assertEqual(self.form.data_proxy.sourceModel(), self.form.model)
-        self.assertEqual("[^()]", str(self.form.data_proxy.filterRegExp().pattern()))
-        self.assertIsInstance(self.form.treeView, QTreeView)
-
-        # Models - theory
-        self.assertIsInstance(self.form.theory_model, QStandardItemModel)
-        self.assertEqual(self.form.freezeView.model().rowCount(), 0)
-        self.assertEqual(self.form.freezeView.model().columnCount(), 0)
-        self.assertEqual(self.form.theory_model.rowCount(), 0)
-        self.assertEqual(self.form.theory_model.columnCount(), 0)
-        self.assertIsInstance(self.form.theory_proxy, QSortFilterProxyModel)
-        self.assertEqual(self.form.theory_proxy.sourceModel(), self.form.theory_model)
-        self.assertEqual("[^()]", str(self.form.theory_proxy.filterRegExp().pattern()))
-        self.assertIsInstance(self.form.freezeView, QTreeView)
-
-    def testWidgets(self):
-        """
-        Test if all required widgets got added
-        """
-    def testLoadButton(self):
-        loadButton = self.form.cmdLoad
-
-        filename = "cyl_400_20.txt"
-        # Initialize signal spy instances
-        spy_file_read = QtSignalSpy(self.form, self.form.communicator.fileReadSignal)
-
-        # Return no files.
-        QtGui.QFileDialog.getOpenFileNames = MagicMock(return_value=None)
-
-        # Click on the Load button
-        QTest.mouseClick(loadButton, Qt.LeftButton)
-
-        # Test the getOpenFileName() dialog called once
-        self.assertTrue(QtGui.QFileDialog.getOpenFileNames.called)
-        QtGui.QFileDialog.getOpenFileNames.assert_called_once()
-
-        # Make sure the signal has not been emitted
-        self.assertEqual(spy_file_read.count(), 0)
-
-        # Now, return a single file
-        QtGui.QFileDialog.getOpenFileNames = MagicMock(return_value=filename)
-
-        # Click on the Load button
-        QTest.mouseClick(loadButton, Qt.LeftButton)
-        QtGui.qApp.processEvents()
-
-        # Test the getOpenFileName() dialog called once
-        self.assertTrue(QtGui.QFileDialog.getOpenFileNames.called)
-        QtGui.QFileDialog.getOpenFileNames.assert_called_once()
-
-        # Expected one spy instance
-        #self.assertEqual(spy_file_read.count(), 1)
-        #self.assertIn(filename, str(spy_file_read.called()[0]['args'][0]))
-
-    def testLoadFiles(self):
-        """
-        Test progress bar update while loading of multiple files
-        """
-        # Set up the spy on progress bar update signal
-        spy_progress_bar_update = QtSignalSpy(self.form,
-            self.form.communicator.progressBarUpdateSignal)
-
-        # Populate the model
-        filename = ["cyl_400_20.txt", "Dec07031.ASC", "cyl_400_20.txt"]
-        self.form.readData(filename)
-
-        # 0, 0, 33, 66, -1 -> 5 signals reaching progressBar
-        self.assertEqual(spy_progress_bar_update.count(), 5)
-
-        expected_list = [0, 0, 33, 66, -1]
-        spied_list = [spy_progress_bar_update.called()[i]['args'][0] for i in xrange(5)]
-        self.assertEqual(expected_list, spied_list)
-        
-    def testDeleteButton(self):
-        """
-        Functionality of the delete button
-        """
-        deleteButton = self.form.cmdDeleteData
-
-        # Mock the confirmation dialog with return=No
-        QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.No)
-
-        # Populate the model
-        filename = ["cyl_400_20.txt", "Dec07031.ASC", "cyl_400_20.txt"]
-        self.form.readData(filename)
-
-        # Assure the model contains three items
-        self.assertEqual(self.form.model.rowCount(), 3)
-
-        # Assure the checkboxes are on
-        item1 = self.form.model.item(0)
-        item2 = self.form.model.item(1)
-        item3 = self.form.model.item(2)
-        self.assertTrue(item1.checkState() == QtCore.Qt.Checked)
-        self.assertTrue(item2.checkState() == QtCore.Qt.Checked)
-        self.assertTrue(item3.checkState() == QtCore.Qt.Checked)
-
-        # Click on the delete  button
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-        # Test the warning dialog called once
-        self.assertTrue(QtGui.QMessageBox.question.called)
-
-        # Assure the model still contains the items
-        self.assertEqual(self.form.model.rowCount(), 3)
-
-        # Now, mock the confirmation dialog with return=Yes
-        QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.Yes)
-
-        # Click on the delete  button
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-        # Test the warning dialog called once
-        self.assertTrue(QtGui.QMessageBox.question.called)
-
-        # Assure the model contains no items
-        self.assertEqual(self.form.model.rowCount(), 0)
-
-        # Click delete once again to assure no nasty behaviour on empty model
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-    def testDeleteTheory(self):
-        """
-        Test that clicking "Delete" in theories tab removes selected indices
-        """
-        deleteButton = self.form.cmdDeleteTheory
-
-        # Mock the confirmation dialog with return=No
-        QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.No)
-
-        # Populate the model
-        item1 = QtGui.QStandardItem(True)
-        item1.setCheckable(True)
-        item1.setCheckState(QtCore.Qt.Checked)
-        item1.setText("item 1")
-        self.form.theory_model.appendRow(item1)
-        item2 = QtGui.QStandardItem(True)
-        item2.setCheckable(True)
-        item2.setCheckState(QtCore.Qt.Unchecked)
-        item2.setText("item 2")
-        self.form.theory_model.appendRow(item2)
-
-        # Assure the model contains two items
-        self.assertEqual(self.form.theory_model.rowCount(), 2)
-
-        # Assure the checkboxes are on
-        self.assertTrue(item1.checkState() == QtCore.Qt.Checked)
-        self.assertTrue(item2.checkState() == QtCore.Qt.Unchecked)
-
-        # Click on the delete  button
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-        # Test the warning dialog called once
-        self.assertTrue(QtGui.QMessageBox.question.called)
-
-        # Assure the model still contains the items
-        self.assertEqual(self.form.theory_model.rowCount(), 2)
-
-        # Now, mock the confirmation dialog with return=Yes
-        QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.Yes)
-
-        # Click on the delete  button
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-        # Test the warning dialog called once
-        self.assertTrue(QtGui.QMessageBox.question.called)
-
-        # Assure the model contains 1 item
-        self.assertEqual(self.form.theory_model.rowCount(), 1)
-
-        # Set the remaining item to checked
-        self.form.theory_model.item(0).setCheckState(QtCore.Qt.Checked)
-
-        # Click on the delete button again
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-        # Assure the model contains no items
-        self.assertEqual(self.form.theory_model.rowCount(), 0)
-
-        # Click delete once again to assure no nasty behaviour on empty model
-        QTest.mouseClick(deleteButton, Qt.LeftButton)
-
-
-    def testSendToButton(self):
-        """
-        Test that clicking the Send To button sends checked data to a perspective
-        """
-        # Send empty data
-        mocked_perspective = self.form.parent.perspective()
-        mocked_perspective.setData = MagicMock()
-
-        # Click on the Send To  button
-        QTest.mouseClick(self.form.cmdSendTo, Qt.LeftButton)
-
-        # The set_data method not called
-        self.assertFalse(mocked_perspective.setData.called)
-               
-        # Populate the model
-        filename = ["cyl_400_20.txt"]
-        self.form.readData(filename)
-
-        # setData is the method we want to see called
-        mocked_perspective = self.form.parent.perspective()
-        mocked_perspective.setData = MagicMock(filename)
-
-        # Assure the checkbox is on
-        self.form.cbSelect.setCurrentIndex(0)
-
-        # Click on the Send To  button
-        QTest.mouseClick(self.form.cmdSendTo, Qt.LeftButton)
-
-        # Test the set_data method called once
-        #self.assertTrue(mocked_perspective.setData.called)
-
-        # open another file
-        filename = ["cyl_400_20.txt"]
-        self.form.readData(filename)
-
-        # Mock the warning message
-        QtGui.QMessageBox = MagicMock()
-
-        # Click on the button
-        QTest.mouseClick(self.form.cmdSendTo, Qt.LeftButton)
-
-        # Assure the message box popped up
-        QtGui.QMessageBox.assert_called_once()
-
-    def testDataSelection(self):
-        """
-        Tests the functionality of the Selection Option combobox
-        """
-        # Populate the model with 1d and 2d data
-        filename = ["cyl_400_20.txt", "Dec07031.ASC"]
-        self.form.readData(filename)
-
-        # Unselect all data
-        self.form.cbSelect.setCurrentIndex(1)
-
-        # Test the current selection
-        item1D = self.form.model.item(0)
-        item2D = self.form.model.item(1)
-        self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked)
-        self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)        
-
-        # Select all data
-        self.form.cbSelect.setCurrentIndex(0)
-
-        # Test the current selection
-        self.assertTrue(item1D.checkState() == QtCore.Qt.Checked)
-        self.assertTrue(item2D.checkState() == QtCore.Qt.Checked)        
-
-        # select 1d data
-        self.form.cbSelect.setCurrentIndex(2)
-
-        # Test the current selection
-        self.assertTrue(item1D.checkState() == QtCore.Qt.Checked)
-        self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)        
-
-        # unselect 1d data
-        self.form.cbSelect.setCurrentIndex(3)
-
-        # Test the current selection
-        self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked)
-        self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)        
-
-        # select 2d data
-        self.form.cbSelect.setCurrentIndex(4)
-
-        # Test the current selection
-        self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked)
-        self.assertTrue(item2D.checkState() == QtCore.Qt.Checked)        
-
-        # unselect 2d data
-        self.form.cbSelect.setCurrentIndex(5)
-
-        # Test the current selection
-        self.assertTrue(item1D.checkState() == QtCore.Qt.Unchecked)
-        self.assertTrue(item2D.checkState() == QtCore.Qt.Unchecked)        
-
-        # choose impossible index and assure the code raises
-        #with self.assertRaises(Exception):
-        #    self.form.cbSelect.setCurrentIndex(6)
-
-    def testFreezeTheory(self):
-        """
-        Assure theory freeze functionality works
-        """
-        # Not yet tested - agree on design first.
-        pass
-
-    def testRecursivelyCloneItem(self):
-        """
-        Test the rescursive QAbstractItem/QStandardItem clone
-        """
-        # Create an item with several branches
-        item1 = QtGui.QStandardItem()
-        item2 = QtGui.QStandardItem()
-        item3 = QtGui.QStandardItem()
-        item4 = QtGui.QStandardItem()
-        item5 = QtGui.QStandardItem()
-        item6 = QtGui.QStandardItem()
-
-        item4.appendRow(item5)
-        item2.appendRow(item4)
-        item2.appendRow(item6)
-        item1.appendRow(item2)
-        item1.appendRow(item3)
-
-        # Clone
-        new_item = self.form.recursivelyCloneItem(item1)
-
-        # assure the trees look identical
-        self.assertEqual(item1.rowCount(), new_item.rowCount())
-        self.assertEqual(item1.child(0).rowCount(), new_item.child(0).rowCount())
-        self.assertEqual(item1.child(1).rowCount(), new_item.child(1).rowCount())
-        self.assertEqual(item1.child(0).child(0).rowCount(), new_item.child(0).child(0).rowCount())
-
-    def testReadData(self):
-        """
-        Test the low level readData() method
-        """
-        filename = ["cyl_400_20.txt"]
-        self.form.manager.add_data = MagicMock()
-
-        # Initialize signal spy instances
-        spy_status_update = QtSignalSpy(self.form, self.form.communicator.statusBarUpdateSignal)
-        spy_data_received = QtSignalSpy(self.form, self.form.communicator.fileDataReceivedSignal)
-
-        # Read in the file
-        self.form.readData(filename)
-
-        # Expected two status bar updates
-        self.assertEqual(spy_status_update.count(), 2)
-        self.assertIn(filename[0], str(spy_status_update.called()[0]['args'][0]))
-
-
-        # Check that the model contains the item
-        self.assertEqual(self.form.model.rowCount(), 1)
-        self.assertEqual(self.form.model.columnCount(), 1)
-
-        # The 0th item header should be the name of the file
-        model_item = self.form.model.index(0,0)
-        model_name = str(self.form.model.data(model_item).toString())
-        self.assertEqual(model_name, filename[0])
-
-    def skip_testDisplayHelp(self): # Skip due to help path change
-        """
-        Test that the Help window gets shown correctly
-        """
-        partial_url = "sasgui/guiframe/data_explorer_help.html"
-        button1 = self.form.cmdHelp
-        button2 = self.form.cmdHelp_2
-
-        # Click on the Help button
-        QTest.mouseClick(button1, Qt.LeftButton)
-        qApp.processEvents()
-
-        # Check the browser
-        self.assertIn(partial_url, str(self.form._helpView.url()))
-        # Close the browser
-        self.form._helpView.close()
-
-        # Click on the Help_2 button
-        QTest.mouseClick(button2, Qt.LeftButton)
-        qApp.processEvents()
-        # Check the browser
-        self.assertIn(partial_url, str(self.form._helpView.url()))
-
-    def testLoadFile(self):
-        """
-        Test the threaded call to readData()
-        """
-        #self.form.loadFile()
-        pass
-
-    def testGetWList(self):
-        """
-        Test the list of known extensions
-        """
-        w_list = self.form.getWlist()
-
-        defaults = 'All (*.*);;canSAS files (*.xml);;SESANS files' +\
-            ' (*.ses);;ASCII files (*.txt);;IGOR 2D files (*.asc);;' +\
-            'IGOR/DAT 2D Q_map files (*.dat);;IGOR 1D files (*.abs);;'+\
-            'HFIR 1D files (*.d1d);;DANSE files (*.sans);;NXS files (*.nxs)'
-        default_list = defaults.split(';;')
-
-        for def_format in default_list:
-            self.assertIn(def_format, w_list)
-       
-    def testLoadComplete(self):
-        """
-        Test the callback method updating the data object
-        """
-        message="Loading Data Complete"
-        data_dict = {"a1":Data1D()}
-        output_data = (data_dict, message)
-
-        self.form.manager.add_data = MagicMock()
-
-        # Initialize signal spy instances
-        spy_status_update = QtSignalSpy(self.form, self.form.communicator.statusBarUpdateSignal)
-        spy_data_received = QtSignalSpy(self.form, self.form.communicator.fileDataReceivedSignal)
-
-        # Read in the file
-        self.form.loadComplete(output_data)
-
-        # "Loading data complete" no longer sent in LoadFile but in callback
-        self.assertIn("Loading Data Complete", str(spy_status_update.called()[0]['args'][0]))
-
-        # Expect one Data Received signal
-        self.assertEqual(spy_data_received.count(), 1)
-
-        # Assure returned dictionary has correct data
-        # We don't know the data ID, so need to iterate over dict
-        data_dict = spy_data_received.called()[0]['args'][0]
-        for data_key, data_value in data_dict.iteritems():
-            self.assertIsInstance(data_value, Data1D)
-
-        # Assure add_data on data_manager was called (last call)
-        self.assertTrue(self.form.manager.add_data.called)
-
-    def testNewPlot1D(self):
-        """
-        Creating new plots from Data1D/2D
-        """
-        loader = Loader()
-        manager = DataManager()
-        PlotHelper.clear()
-        self.form.enableGraphCombo(None)
-
-        # Make sure the controls are disabled
-        self.assertFalse(self.form.cbgraph.isEnabled())
-        self.assertFalse(self.form.cmdAppend.isEnabled())
-
-        # get Data1D
-        p_file="cyl_400_20.txt"
-        output_object = loader.load(p_file)
-        new_data = [manager.create_gui_data(output_object, p_file)]
-
-        # Mask retrieval of the data
-        self.form.plotsFromCheckedItems = MagicMock(return_value=new_data)
-
-        # Mask plotting
-        self.form.parent.workspace = MagicMock()
-
-        # Call the plotting method
-        self.form.newPlot()
-
-        # The plot was registered
-        self.assertEqual(len(PlotHelper.currentPlots()), 1)
-
-        self.assertTrue(self.form.cbgraph.isEnabled())
-        self.assertTrue(self.form.cmdAppend.isEnabled())
-
-    def testNewPlot2D(self):
-        """
-        Creating new plots from Data1D/2D
-        """
-        loader = Loader()
-        manager = DataManager()
-        PlotHelper.clear()
-        self.form.enableGraphCombo(None)
-
-        # Make sure the controls are disabled
-        self.assertFalse(self.form.cbgraph.isEnabled())
-        self.assertFalse(self.form.cmdAppend.isEnabled())
-
-        # get Data2D
-        p_file="Dec07031.ASC"
-        output_object = loader.load(p_file)
-        new_data = [manager.create_gui_data(output_object, p_file)]
-
-        # Mask retrieval of the data
-        self.form.plotsFromCheckedItems = MagicMock(return_value=new_data)
-
-        # Mask plotting
-        self.form.parent.workspace = MagicMock()
-
-        # Call the plotting method
-        self.form.newPlot()
-
-        # The plot was registered
-        self.assertEqual(len(PlotHelper.currentPlots()), 1)
-
-        self.assertTrue(self.form.cbgraph.isEnabled())
-        self.assertTrue(self.form.cmdAppend.isEnabled())
-
-    @patch('sas.qtgui.GuiUtils.plotsFromCheckedItems')
-    def testAppendPlot(self, test_patch):
-        """
-        Creating new plots from Data1D/2D
-        """
-        loader = Loader()
-        manager = DataManager()
-
-        PlotHelper.clear()
-        self.form.enableGraphCombo(None)
-
-        # Make sure the controls are disabled
-        self.assertFalse(self.form.cbgraph.isEnabled())
-        self.assertFalse(self.form.cmdAppend.isEnabled())
-
-        # get Data1D
-        p_file="cyl_400_20.txt"
-        output_object = loader.load(p_file)
-        output_item = QtGui.QStandardItem()
-        new_data = [(output_item, manager.create_gui_data(output_object, p_file))]
-
-        # Mask plotting
-        self.form.parent.workspace = MagicMock()
-
-        # Mask the plot show call
-        Plotter.show = MagicMock()
-
-        # Mask retrieval of the data
-        test_patch.return_value = new_data
-
-        # Call the plotting method
-        self.form.newPlot()
-
-        # Call the plotting method again, so we have 2 graphs
-        self.form.newPlot()
-
-        # See that we have two plots
-        self.assertEqual(len(PlotHelper.currentPlots()), 2)
-
-        # Add data to plot #1
-        self.form.cbgraph.setCurrentIndex(1)
-        self.form.appendPlot()
-
-        # See that we still have two plots
-        self.assertEqual(len(PlotHelper.currentPlots()), 2)
-
-    def testUpdateGraphCombo(self):
-        """
-        Test the combo box update
-        """
-        PlotHelper.clear()
-
-        graph_list=["1","2","3"]
-        self.form.updateGraphCombo(graph_list)
-
-        self.assertEqual(self.form.cbgraph.count(), 3)
-        self.assertEqual(self.form.cbgraph.currentText(), '1')
-
-        graph_list=[]
-        self.form.updateGraphCombo(graph_list)
-        self.assertEqual(self.form.cbgraph.count(), 0)
-
-    def testUpdateModelFromPerspective(self):
-        """
-        Assure the model update is correct
-        """
-        good_item = QtGui.QStandardItem()
-        bad_item = "I'm so bad"
-
-        self.form.model.reset = MagicMock()
-
-        self.form.updateModelFromPerspective(good_item)
-
-        # See that the model got reset
-        self.form.model.reset.assert_called_once()
-
-        # See that the bad item causes raise
-        with self.assertRaises(Exception):
-            self.form.updateModelFromPerspective(bad_item)
-
-    def testContextMenu(self):
-        """
-        See if the context menu is present
-        """
-        # get Data1D
-        p_file=["cyl_400_20.txt"]
-        # Read in the file
-        output, message = self.form.readData(p_file)
-        self.form.loadComplete((output, message))
-
-        # Pick up the treeview index corresponding to that file
-        index = self.form.treeView.indexAt(QtCore.QPoint(5,5))
-        self.form.show()
-
-        # Find out the center pointof the treeView row
-        rect = self.form.treeView.visualRect(index).center()
-
-        self.form.context_menu.exec_ = MagicMock()
-
-        # Move the mouse pointer to the first row
-        QTest.mouseMove(self.form.treeView.viewport(), pos=rect)
-
-        # This doesn't invoke the action/signal. Investigate why?
-        # QTest.mouseClick(self.form.treeView.viewport(), Qt.RightButton, pos=rect)
-
-        # Instead, send the signal directly
-        self.form.treeView.customContextMenuRequested.emit(rect)
-
-        # app.exec_() # debug
-
-        # See that the menu has been shown
-        self.form.context_menu.exec_.assert_called_once()
-
-    def testShowDataInfo(self):
-        """
-        Test of the showDataInfo method
-        """
-        # get Data1D
-        p_file=["cyl_400_20.txt"]
-        # Read in the file
-        output, message = self.form.readData(p_file)
-        self.form.loadComplete((output, message))
-
-        # select the data
-        self.form.treeView.selectAll()
-
-        # Call the tested method
-        self.form.showDataInfo()
-
-        # Test the properties
-        self.assertTrue(self.form.txt_widget.isReadOnly())
-        self.assertEqual(self.form.txt_widget.windowTitle(), "Data Info: cyl_400_20.txt")
-        self.assertIn("Waveln_max", self.form.txt_widget.toPlainText())
-
-        # Slider moved all the way up
-        self.assertEqual(self.form.txt_widget.verticalScrollBar().sliderPosition(), 0)
-
-    def testSaveDataAs(self):
-        """
-        Test the Save As context menu action
-        """
-        # get Data1D
-        p_file=["cyl_400_20.txt"]
-        # Read in the file
-        output, message = self.form.readData(p_file)
-        self.form.loadComplete((output, message))
-
-        # select the data
-        self.form.treeView.selectAll()
-
-        QFileDialog.getSaveFileName = MagicMock()
-
-        # Call the tested method
-        self.form.saveDataAs()
-        QFileDialog.getSaveFileName.assert_called_with(
-                                caption="Save As",
-                                directory='cyl_400_20_out.txt',
-                                filter='Text files (*.txt);;CanSAS 1D files(*.xml)',
-                                parent=None)
-        QFileDialog.getSaveFileName.assert_called_once()
-
-        # get Data2D
-        p_file=["Dec07031.ASC"]
-        # Read in the file
-        output, message = self.form.readData(p_file)
-        self.form.loadComplete((output, message))
-
-        # select the data
-        index = self.form.model.index(1, 0)
-        selmodel = self.form.treeView.selectionModel()
-        selmodel.setCurrentIndex(index, QItemSelectionModel.NoUpdate)
-        selmodel.select(index, QItemSelectionModel.Select|QItemSelectionModel.Rows)
-
-        QFileDialog.getSaveFileName = MagicMock()
-
-        # Call the tested method
-        self.form.saveDataAs()
-        QFileDialog.getSaveFileName.assert_called_with(
-                                caption="Save As",
-                                directory='Dec07031_out.dat',
-                                filter='IGOR/DAT 2D file in Q_map (*.dat)',
-                                parent=None)
-        QFileDialog.getSaveFileName.assert_called_once()
-
-    def testQuickDataPlot(self):
-        """
-        Quick data plot generation.
-        """
-        # get Data1D
-        p_file=["cyl_400_20.txt"]
-        # Read in the file
-        output, message = self.form.readData(p_file)
-        self.form.loadComplete((output, message))
-
-        # select the data
-        self.form.treeView.selectAll()
-
-        Plotter.show = MagicMock() # for masking the display
-
-        self.form.quickDataPlot()
-        self.assertTrue(Plotter.show.called)
-
-    def testQuickData3DPlot(self):
-        """
-        Slow(er) 3D data plot generation.
-        """
-        # get Data1D
-        p_file=["Dec07031.ASC"]
-        # Read in the file
-        output, message = self.form.readData(p_file)
-        self.form.loadComplete((output, message))
-
-        # select the data
-        self.form.treeView.selectAll()
-
-        Plotter2D.show = MagicMock() # for masking the display
-
-        self.form.quickData3DPlot()
-
-        self.assertTrue(Plotter2D.show.called)
-
-    def testShowEditMask(self):
-        """
-        Edit mask on a 2D plot.
-
-        TODO: add content once plotting finalized
-        """
-        pass
-
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/DensityCalculatorTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/DensityCalculatorTest.py	(revision 416fa8fe6ed121e335fb8f0e75cdd9a8ab89b80d)
+++ 	(revision )
@@ -1,121 +1,0 @@
-import sys
-import unittest
-import webbrowser
-
-from PyQt4 import QtGui
-from PyQt4.QtTest import QTest
-from PyQt4 import QtCore
-from mock import MagicMock
-
-####### TEMP
-import path_prepare
-#######
-
-# Local
-from DensityPanel import DensityPanel
-from DensityPanel import toMolarMass
-from sas.qtgui.GuiUtils import FormulaValidator
-
-import sas.qtgui.LocalConfig
-
-app = QtGui.QApplication(sys.argv)
-
-class ToMolarMassTest(unittest.TestCase):
-    """ Test the auxiliary conversion method"""
-    def testGoodEasy(self):
-        self.assertEqual(toMolarMass("H2"), "2.01588")
-
-    def testGoodComplex(self):
-        self.assertEqual(toMolarMass("H24O12C4C6N2Pu"), "608.304")
-
-    def testGoodComplex2(self):
-        self.assertEqual(toMolarMass("(H2O)0.5(D2O)0.5"), "19.0214")
-
-    def testBadInputInt(self):
-        self.assertEqual(toMolarMass(1), "")
-
-    def testBadInputStr(self):
-        self.assertEqual(toMolarMass("Im a bad string"), "")
-
-class DensityCalculatorTest(unittest.TestCase):
-    '''Test the DensityCalculator'''
-    def setUp(self):
-        '''Create the DensityCalculator'''
-        self.widget = DensityPanel(None)
-
-    def tearDown(self):
-        '''Destroy the DensityCalculator'''
-        self.widget.close()
-        self.widget = None
-
-    def testDefaults(self):
-        '''Test the GUI in its default state'''
-        self.assertIsInstance(self.widget, QtGui.QWidget)
-        self.assertEqual(self.widget.windowTitle(), "Density/Volume Calculator")
-        self.assertIsInstance(self.widget.ui.editMolecularFormula.validator(), FormulaValidator)
-        self.assertEqual(self.widget.ui.editMolecularFormula.styleSheet(), '')
-        self.assertEqual(self.widget.model.columnCount(), 1)
-        self.assertEqual(self.widget.model.rowCount(), 4)
-        self.assertEqual(self.widget.sizePolicy().Policy(), QtGui.QSizePolicy.Fixed)
-
-    def testSimpleEntry(self):
-        ''' Default compound calculations '''
-        self.widget.ui.editMolarVolume.insert("1.0")
-
-        self.widget.show()
-        # Send tab x3
-        key = QtCore.Qt.Key_Tab
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.qWait(100)
-
-        # Assure the mass density field is set
-        self.assertEqual(self.widget.ui.editMassDensity.text(), '18.0153')
-
-        # Change mass density
-        self.widget.ui.editMassDensity.insert("16.0")
-        # Send shift-tab to update the molar volume field
-        key =  QtCore.Qt.Key_Tab
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.ShiftModifier)
-        QTest.qWait(100)
-
-        # Assure the molar volume field got updated
-        self.assertEqual(self.widget.ui.editMolarVolume.text(), '1.12595625')
-
-    def testComplexEntryAndReset(self):
-        ''' User entered compound calculations and subsequent reset'''
-
-        self.widget.ui.editMolecularFormula.clear()
-        self.widget.ui.editMolecularFormula.insert("KMnO4")
-        self.widget.ui.editMolarVolume.insert("2.0")
-
-        self.widget.show()
-        # Send tab x3
-        key = QtCore.Qt.Key_Tab
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.qWait(100)
-
-        # Assure the mass density field is set
-        self.assertEqual(self.widget.ui.editMassDensity.text(), '79.017')
-
-        # Reset the widget
-        self.widget.modelReset()
-
-        self.assertEqual(self.widget.ui.editMolecularFormula.text(), "H2O")
-        self.assertEqual(self.widget.ui.editMolarMass.text(), "18.0153")
-        self.assertEqual(self.widget.ui.editMolarVolume.text(), "")
-        self.assertEqual(self.widget.ui.editMassDensity.text(), "")
-
-        #self.widget.exec_()
-
-    def testHelp(self):
-        """ Assure help file is shown """
-
-        # this should not rise
-        self.widget.displayHelp()
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/DroppableDataLoadWidgetTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/DroppableDataLoadWidgetTest.py	(revision 31c5b583d8c577c4ed72be87d22d34ec2ed50c04)
+++ 	(revision )
@@ -1,75 +1,0 @@
-import sys
-import unittest
-
-from PyQt4.QtGui import QApplication
-from PyQt4.QtTest import QTest
-from PyQt4 import QtCore
-
-# set up import paths
-import path_prepare
-
-from DroppableDataLoadWidget import DroppableDataLoadWidget
-from GuiUtils import *
-from UnitTesting.TestUtils import QtSignalSpy
-
-app = QApplication(sys.argv)
-
-class DroppableDataLoadWidgetTest(unittest.TestCase):
-    '''Test the DroppableDataLoadWidget GUI'''
-    def setUp(self):
-        '''Create the GUI'''
-        class dummy_manager(object):
-            def communicator(self):
-                return Communicate()
-            def perspective(self):
-                return MyPerspective()
-
-        self.form = DroppableDataLoadWidget(None, guimanager=dummy_manager())
-
-        # create dummy mime object
-        self.mime_data = QtCore.QMimeData()
-        self.testfile = 'testfile.txt'
-        self.mime_data.setUrls([QtCore.QUrl(self.testfile)])
-
-    def testDragIsOK(self):
-        """
-        Test the item being dragged over the load widget
-        """
-        good_drag_event = QtGui.QDragMoveEvent(QtCore.QPoint(0,0),
-                                               QtCore.Qt.CopyAction,
-                                               self.mime_data,
-                                               QtCore.Qt.LeftButton,
-                                               QtCore.Qt.NoModifier)
-        mime_data = QtCore.QMimeData()
-        bad_drag_event = QtGui.QDragMoveEvent(QtCore.QPoint(0,0),
-                                               QtCore.Qt.CopyAction,
-                                               mime_data,
-                                               QtCore.Qt.LeftButton,
-                                               QtCore.Qt.NoModifier)
-
-        # Call the drag handler with good event
-        self.assertTrue(self.form.dragIsOK(good_drag_event))
-
-        # Call the drag handler with bad event
-        self.assertFalse(self.form.dragIsOK(bad_drag_event))
-
-    def testDropEvent(self):
-        """
-        Test what happens if an object is dropped onto the load widget
-        """
-        spy_file_read = QtSignalSpy(self.form, self.form.communicator.fileReadSignal)
-
-        drop_event = QtGui.QDropEvent(QtCore.QPoint(0,0),
-                                           QtCore.Qt.CopyAction,
-                                           self.mime_data,
-                                           QtCore.Qt.LeftButton,
-                                           QtCore.Qt.NoModifier)
-
-        self.form.dropEvent(drop_event)
-        QtGui.qApp.processEvents()
-        self.assertEqual(spy_file_read.count(), 1)
-        self.assertIn(self.testfile, str(spy_file_read.signal(index=0)))
-
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/GuiManagerTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/GuiManagerTest.py	(revision 2155824bc3dcd6c0afe1204caa0357472cf9b060)
+++ 	(revision )
@@ -1,332 +1,0 @@
-import sys
-import subprocess
-import unittest
-import webbrowser
-import logging
-
-from PyQt4.QtGui import *
-from PyQt4.QtTest import QTest
-from PyQt4.QtCore import *
-from PyQt4.QtWebKit import *
-from mock import MagicMock
-
-# set up import paths
-import path_prepare
-
-# Local
-from sas.qtgui.DataExplorer import DataExplorerWindow
-from sas.qtgui.AboutBox import AboutBox
-from sas.qtgui.WelcomePanel import WelcomePanel
-from sas.qtgui.IPythonWidget import IPythonWidget
-
-from GuiManager import Acknowledgements, GuiManager
-from MainWindow import MainSasViewWindow
-from UnitTesting.TestUtils import QtSignalSpy
-
-app = QApplication(sys.argv)
-
-class GuiManagerTest(unittest.TestCase):
-    '''Test the Main Window functionality'''
-    def setUp(self):
-        '''Create the tested object'''
-        class MainWindow(MainSasViewWindow):
-            # Main window of the application
-            def __init__(self, reactor, parent=None):
-                super(MainWindow, self).__init__(parent)
-        
-                # define workspace for dialogs.
-                self.workspace = QWorkspace(self)
-                self.setCentralWidget(self.workspace)
-
-        self.manager = GuiManager(MainWindow(None))
-
-    def tearDown(self):
-        '''Destroy the GUI'''
-        self.manager = None
-
-    def testDefaults(self):
-        """
-        Test the object in its default state
-        """
-        self.assertIsInstance(self.manager.filesWidget, DataExplorerWindow)
-        self.assertIsInstance(self.manager.dockedFilesWidget, QDockWidget)
-        self.assertIsInstance(self.manager.dockedFilesWidget.widget(), DataExplorerWindow)
-        self.assertEqual(self.manager.dockedFilesWidget.features(), QDockWidget.NoDockWidgetFeatures)
-        self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.dockedFilesWidget), Qt.LeftDockWidgetArea)
-
-        self.assertIsInstance(self.manager.logDockWidget, QDockWidget)
-        self.assertIsInstance(self.manager.logDockWidget.widget(), QTextBrowser)
-        self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.logDockWidget), Qt.BottomDockWidgetArea)
-
-        self.assertIsInstance(self.manager.ackWidget, Acknowledgements)
-        self.assertIsInstance(self.manager.aboutWidget, AboutBox)
-        self.assertIsInstance(self.manager.welcomePanel, WelcomePanel)
-
-    def skip_testLogging(self):
-        """
-        Test logging of stdout, stderr and log messages
-        """
-        # See if the log window is empty
-        self.assertEqual(self.manager.logDockWidget.widget().toPlainText(), "")
-
-        # Now, send some message to stdout.
-        # We are in the MainWindow scope, so simple 'print' will work
-        message = "from stdout"
-        print message
-        self.assertIn(message, self.manager.logDockWidget.widget().toPlainText())
-
-        # Send some message to stderr
-        message = "from stderr"
-        sys.stderr.write(message)
-        self.assertIn(message, self.manager.logDockWidget.widget().toPlainText())
-
-        # And finally, send a log message
-        import logging
-        message = "from logging"
-        message_logged = "ERROR: " + message
-        logging.error(message)
-        self.assertIn(message_logged, self.manager.logDockWidget.widget().toPlainText())
-
-    def testConsole(self):
-        """
-        Test the docked QtConsole
-        """
-        # Invoke the console action
-        self.manager.actionPython_Shell_Editor()
-
-        # Test the widegt properties
-        self.assertIsInstance(self.manager.ipDockWidget, QDockWidget)
-        self.assertIsInstance(self.manager.ipDockWidget.widget(), IPythonWidget)
-        self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.ipDockWidget), Qt.RightDockWidgetArea)
-
-    def testUpdatePerspective(self):
-        """
-        """
-        pass
-
-    def testUpdateStatusBar(self):
-        """
-        """
-        pass
-
-    def testSetData(self):
-        """
-        """
-        pass
-
-    def testQuitApplication(self):
-        """
-        Test that the custom exit method is called on shutdown
-        """
-        self.manager._workspace.show()
-
-        # Must mask sys.exit, otherwise the whole testing process stops.
-        sys.exit = MagicMock()
-
-        # Say No to the close dialog
-        QMessageBox.question = MagicMock(return_value=QMessageBox.No)
-
-        # Open, then close the manager
-        self.manager.quitApplication()
-
-        # See that the MessageBox method got called
-        #self.assertTrue(QMessageBox.question.called)
-
-        # Say Yes to the close dialog
-        QMessageBox.question = MagicMock(return_value=QMessageBox.Yes)
-
-        # Open, then close the manager
-        self.manager.quitApplication()
-
-        # See that the MessageBox method got called
-        #self.assertTrue(QMessageBox.question.called)
-
-    def testCheckUpdate(self):
-        """
-        Tests the SasView website version polling
-        """
-        self.manager.processVersion = MagicMock()
-        version = {'update_url'  : 'http://www.sasview.org/sasview.latestversion', 
-                   'version'     : '4.1.0',
-                   'download_url': 'https://github.com/SasView/sasview/releases'}
-        self.manager.checkUpdate()
-
-        self.manager.processVersion.assert_called_with(version)
-
-        pass
-
-    def testProcessVersion(self):
-        """
-        Tests the version checker logic
-        """
-        # 1. version = 0.0.0
-        version_info = {u'version' : u'0.0.0'}
-        spy_status_update = QtSignalSpy(self.manager, self.manager.communicate.statusBarUpdateSignal)
-
-        self.manager.processVersion(version_info)
-
-        self.assertEqual(spy_status_update.count(), 1)
-        message = 'Could not connect to the application server. Please try again later.'
-        self.assertIn(message, str(spy_status_update.signal(index=0)))
-
-        # 2. version < LocalConfig.__version__
-        version_info = {u'version' : u'0.0.1'}
-        spy_status_update = QtSignalSpy(self.manager, self.manager.communicate.statusBarUpdateSignal)
-
-        self.manager.processVersion(version_info)
-
-        self.assertEqual(spy_status_update.count(), 1)
-        message = 'You have the latest version of SasView'
-        self.assertIn(message, str(spy_status_update.signal(index=0)))
-
-        # 3. version > LocalConfig.__version__
-        version_info = {u'version' : u'999.0.0'}
-        spy_status_update = QtSignalSpy(self.manager, self.manager.communicate.statusBarUpdateSignal)
-        webbrowser.open = MagicMock()
-
-        self.manager.processVersion(version_info)
-
-        self.assertEqual(spy_status_update.count(), 1)
-        message = 'Version 999.0.0 is available!'
-        self.assertIn(message, str(spy_status_update.signal(index=0)))
-
-        webbrowser.open.assert_called_with("https://github.com/SasView/sasview/releases")
-
-        # 4. couldn't load version
-        version_info = {}
-        logging.error = MagicMock()
-        spy_status_update = QtSignalSpy(self.manager, self.manager.communicate.statusBarUpdateSignal)
-
-        self.manager.processVersion(version_info)
-
-        # Retrieve and compare arguments of the mocked call
-        message = "guiframe: could not get latest application version number"
-        args, _ = logging.error.call_args
-        self.assertIn(message, args[0])
-
-        # Check the signal message
-        message = 'Could not connect to the application server.'
-        self.assertIn(message, str(spy_status_update.signal(index=0)))
-
-    def testActions(self):
-        """
-        """
-        pass
-
-    #### FILE ####
-    def testActionLoadData(self):
-        """
-        Menu File/Load Data File(s)
-        """
-        # Mock the system file open method
-        QFileDialog.getOpenFileNames = MagicMock(return_value=None)
-
-        # invoke the action
-        self.manager.actionLoadData()
-
-        # Test the getOpenFileName() dialog called once
-        self.assertTrue(QFileDialog.getOpenFileNames.called)
-
-    def testActionLoadDataFolder(self):
-        """
-        Menu File/Load Data Folder
-        """
-        # Mock the system file open method
-        QFileDialog.getExistingDirectory = MagicMock(return_value=None)
-
-        # invoke the action
-        self.manager.actionLoad_Data_Folder()
-
-        # Test the getOpenFileName() dialog called once
-        self.assertTrue(QFileDialog.getExistingDirectory.called)
-
-    #### VIEW ####
-    def testActionHideToolbar(self):
-        """
-        Menu View/Hide Toolbar
-        """
-        # Need to display the main window to initialize the toolbar.
-        self.manager._workspace.show()
-
-        # Check the initial state
-        self.assertTrue(self.manager._workspace.toolBar.isVisible())
-        self.assertEqual('Hide Toolbar', self.manager._workspace.actionHide_Toolbar.text())
-
-        # Invoke action
-        self.manager.actionHide_Toolbar()
-
-        # Assure changes propagated correctly
-        self.assertFalse(self.manager._workspace.toolBar.isVisible())
-        self.assertEqual('Show Toolbar', self.manager._workspace.actionHide_Toolbar.text())
-
-        # Revert
-        self.manager.actionHide_Toolbar()
-
-        # Assure the original values are back
-        self.assertTrue(self.manager._workspace.toolBar.isVisible())
-        self.assertEqual('Hide Toolbar', self.manager._workspace.actionHide_Toolbar.text())
-
-
-    #### HELP ####
-    def testActionDocumentation(self):
-        """
-        Menu Help/Documentation
-        """
-        #Mock the QWebView method
-        QWebView.show = MagicMock()
-
-        # Assure the filename is correct
-        self.assertIn("index.html", self.manager._helpLocation)
-
-        # Invoke the action
-        self.manager.actionDocumentation()
-
-        # Check if show() got called
-        self.assertTrue(QWebView.show.called)
-
-    def skip_testActionTutorial(self):
-        """
-        Menu Help/Tutorial
-        """
-        # Mock subprocess.Popen
-        subprocess.Popen = MagicMock()
-
-        tested_location = self.manager._tutorialLocation
-
-        # Assure the filename is correct
-        self.assertIn("Tutorial.pdf", tested_location)
-
-        # Invoke the action
-        self.manager.actionTutorial()
-
-        # Check if popen() got called
-        self.assertTrue(subprocess.Popen.called)
-
-        #Check the popen() call arguments
-        subprocess.Popen.assert_called_with([tested_location], shell=True)
-
-    def testActionAcknowledge(self):
-        """
-        Menu Help/Acknowledge
-        """
-        self.manager.actionAcknowledge()
-
-        # Check if the window is actually opened.
-        self.assertTrue(self.manager.ackWidget.isVisible())
-        self.assertIn("developers@sasview.org", self.manager.ackWidget.label.text())
-
-    def testActionCheck_for_update(self):
-        """
-        Menu Help/Check for update
-        """
-        # Just make sure checkUpdate is called.
-        self.manager.checkUpdate = MagicMock()
-
-        self.manager.actionCheck_for_update()
-
-        self.assertTrue(self.manager.checkUpdate.called)
-             
-       
-if __name__ == "__main__":
-    unittest.main()
-
Index: src/sas/qtgui/UnitTesting/GuiUtilsTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/GuiUtilsTest.py	(revision 965fbd854b36d33e3c78f5ffed0a6040af2ad43e)
+++ 	(revision )
@@ -1,443 +1,0 @@
-import sys
-import unittest
-import webbrowser
-
-from PyQt4 import QtCore
-from PyQt4 import QtGui
-from mock import MagicMock
-
-# set up import paths
-import path_prepare
-
-# SV imports
-from sas.sascalc.dataloader.loader import Loader
-from sas.sasgui.guiframe.data_manager import DataManager
-from sas.sasgui.guiframe.dataFitting import Data1D
-from sas.sasgui.guiframe.dataFitting import Data2D
-
-# Tested module
-from GuiUtils import *
-
-app = QtGui.QApplication(sys.argv)
-
-class GuiUtilsTest(unittest.TestCase):
-    '''Test the GUI Utilities methods'''
-    def setUp(self):
-        '''Empty'''
-        pass
-
-    def tearDown(self):
-        '''Empty'''
-        pass
-
-    def testDefaults(self):
-        """
-        Test all the global constants defined in the file.
-        """
-        # Should probably test the constants in the file,
-        # but this will done after trimming down GuiUtils
-        # and retaining only necessary variables.
-        pass
-
-    def testGetAppDir(self):
-        """
-        """
-        pass
-
-    def testGetUserDirectory(self):
-        """
-        Simple test of user directory getter
-        """
-        home_dir = os.path.expanduser("~")
-        self.assertIn(home_dir, get_user_directory())
-
-    def testCommunicate(self):
-        """
-        Test the container class with signal definitions
-        """
-        com = Communicate()
-
-        # All defined signals
-        list_of_signals = [
-            'fileReadSignal',
-            'fileDataReceivedSignal',
-            'statusBarUpdateSignal',
-            'updatePerspectiveWithDataSignal',
-            'updateModelFromPerspectiveSignal',
-            'plotRequestedSignal',
-            'progressBarUpdateSignal',
-            'activeGraphName',
-        ]
-
-        # Assure all signals are defined.
-        for signal in list_of_signals:
-            self.assertIn(signal, dir(com))
-
-    def testupdateModelItem(self):
-        """
-        Test the generic QModelItem update method
-        """
-        test_item = QtGui.QStandardItem()
-        test_list = ['aa', 4, True, ]
-        name = "Black Sabbath"
-
-        # update the item
-        updateModelItem(test_item, test_list, name)
-
-        # Make sure test_item got all data added
-        self.assertEqual(test_item.child(0).text(), name)
-        list_from_item = test_item.child(0).data().toList()
-        self.assertIsInstance(list_from_item, list)
-        self.assertEqual(list_from_item[0].toPyObject(), test_list[0])
-        self.assertEqual(list_from_item[1].toPyObject(), test_list[1])
-        self.assertEqual(list_from_item[2].toPyObject(), test_list[2])
-
-    def testupdateModelItemWithPlot(self):
-        """
-        Test the QModelItem checkbox update method
-        """
-        test_item = QtGui.QStandardItem()
-        test_list = ['aa','11']
-        update_data = QtCore.QVariant(test_list)
-        name = "Black Sabbath"
-
-        # update the item
-        updateModelItemWithPlot(test_item, update_data, name)
-        
-        # Make sure test_item got all data added
-        self.assertEqual(test_item.child(0).text(), name)
-        self.assertTrue(test_item.child(0).isCheckable())
-        list_from_item = test_item.child(0).child(0).data().toPyObject()
-        self.assertIsInstance(list_from_item, list)
-        self.assertEqual(str(list_from_item[0]), test_list[0])
-        self.assertEqual(str(list_from_item[1]), test_list[1])
-
-
-    def testPlotsFromCheckedItems(self):
-        """
-        Test addition of a plottable to the model
-        """
-
-        # Mockup data
-        test_list0 = "FRIDAY"
-        test_list1 = "SATURDAY"
-        test_list2 = "MONDAY"
-
-        # Main item ("file")
-        checkbox_model = QtGui.QStandardItemModel()
-        checkbox_item = QtGui.QStandardItem(True)
-        checkbox_item.setCheckable(True)
-        checkbox_item.setCheckState(QtCore.Qt.Checked)
-        test_item0 = QtGui.QStandardItem()
-        test_item0.setData(QtCore.QVariant(test_list0))
-
-        # Checked item 1
-        test_item1 = QtGui.QStandardItem(True)
-        test_item1.setCheckable(True)
-        test_item1.setCheckState(QtCore.Qt.Checked)
-        object_item = QtGui.QStandardItem()
-        object_item.setData(QtCore.QVariant(test_list1))
-        test_item1.setChild(0, object_item)
-
-        checkbox_item.setChild(0, test_item0)
-        checkbox_item.appendRow(test_item1)
-
-        # Unchecked item 2
-        test_item2 = QtGui.QStandardItem(True)
-        test_item2.setCheckable(True)
-        test_item2.setCheckState(QtCore.Qt.Unchecked)
-        object_item = QtGui.QStandardItem()
-        object_item.setData(QtCore.QVariant(test_list2))
-        test_item2.setChild(0, object_item)
-        checkbox_item.appendRow(test_item2)
-
-        checkbox_model.appendRow(checkbox_item)
-
-        # Pull out the "plottable" documents
-        plot_list = plotsFromCheckedItems(checkbox_model)
-
-        # Make sure only the checked data is present
-        # FRIDAY IN
-        self.assertIn(test_list0, plot_list[0])
-        # SATURDAY IN
-        self.assertIn(test_list1, plot_list[1])
-        # MONDAY NOT IN
-        self.assertNotIn(test_list2, plot_list[0])
-        self.assertNotIn(test_list2, plot_list[1])
-
-    def testInfoFromData(self):
-        """
-        Test Info element extraction from a plottable object
-        """
-        loader = Loader()
-        manager = DataManager()
-
-        # get Data1D
-        p_file="cyl_400_20.txt"
-        output_object = loader.load(p_file)
-        new_data = manager.create_gui_data(output_object, p_file)
-
-        # Extract Info elements into a model item
-        item = infoFromData(new_data)
-
-        # Test the item and its children
-        self.assertIsInstance(item, QtGui.QStandardItem)
-        self.assertEqual(item.rowCount(), 5)
-        self.assertEqual(item.text(), "Info")
-        self.assertIn(p_file,   item.child(0).text())
-        self.assertIn("Run",    item.child(1).text())
-        self.assertIn("Data1D", item.child(2).text())
-        self.assertIn(p_file,   item.child(3).text())
-        self.assertIn("Process",item.child(4).text())
-
-    def testOpenLink(self):
-        """
-        Opening a link in the external browser
-        """
-        good_url1 = r"http://test.test.com"
-        good_url2 = r"mailto:test@mail.com"
-        good_url3 = r"https://127.0.0.1"
-
-        bad_url1 = ""
-        bad_url2 = QtGui.QStandardItem()
-        bad_url3 = r"poop;//**I.am.a.!bad@url"
-
-        webbrowser.open = MagicMock()
-        openLink(good_url1)
-        openLink(good_url2)
-        openLink(good_url3)
-        self.assertEqual(webbrowser.open.call_count, 3)
-
-        with self.assertRaises(AttributeError):
-            openLink(bad_url1)
-        with self.assertRaises(AttributeError):
-            openLink(bad_url2)
-        with self.assertRaises(AttributeError):
-            openLink(bad_url3)
-
-    def testRetrieveData1d(self):
-        """
-        """
-        with self.assertRaises(AttributeError):
-            retrieveData1d("BOOP")
-
-        #data = Data1D()
-        #with self.assertRaises(ValueError):
-        #    retrieveData1d(data)
-
-        data = Data1D(x=[1.0, 2.0, 3.0], y=[10.0, 11.0, 12.0])
-
-        text = retrieveData1d(data)
-
-        self.assertIn("Temperature:", text)
-        self.assertIn("Beam_size:", text)
-        self.assertIn("X_min = 1.0:  X_max = 3.0", text)
-        self.assertIn("3.0 \t12.0 \t0.0 \t0.0", text)
-
-    def testRetrieveData2d(self):
-        """
-        """
-        with self.assertRaises(AttributeError):
-            retrieveData2d("BOOP")
-        data = Data2D(image=[1.0, 2.0, 3.0],
-                      err_image=[0.01, 0.02, 0.03],
-                      qx_data=[0.1, 0.2, 0.3],
-                      qy_data=[0.1, 0.2, 0.3])
-
-        text = retrieveData2d(data)
-
-        self.assertIn("Type:         Data2D", text)
-        self.assertIn("I_min = 1.0", text)
-        self.assertIn("I_max = 3.0", text)
-        self.assertIn("2 \t0.3 \t0.3 \t3.0 \t0.03 \t0.0 \t0.0", text)
-
-    def testOnTXTSave(self):
-        """
-        Test the file writer for saving 1d/2d data
-        """
-        path = "test123"
-        if os.path.isfile(path):
-            os.remove(path)
-
-        # Broken data
-        data = Data1D(x=[1.0, 2.0, 3.0], y=[])
-        # Expect a raise
-        with self.assertRaises(IndexError):
-            onTXTSave(data, path)
-
-        # Good data - no dX/dY
-        data = Data1D(x=[1.0, 2.0, 3.0], y=[10.0, 11.0, 12.0])
-        onTXTSave(data, path)
-
-        self.assertTrue(os.path.isfile(path))
-        with open(path,'r') as out:
-            data_read = out.read()
-            self.assertEqual("<X>   <Y>\n1  10\n2  11\n3  12\n", data_read)
-
-        if os.path.isfile(path):
-            os.remove(path)
-
-        # Good data - with dX/dY
-        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])
-
-        onTXTSave(data, path)
-        with open(path,'r') as out:
-            data_read = out.read()
-            self.assertIn("<X>   <Y>   <dY>   <dX>\n", data_read)
-            self.assertIn("1  10  0.1  0.1\n", data_read)
-            self.assertIn("2  11  0.2  0.2\n", data_read)
-            self.assertIn("3  12  0.3  0.3\n", data_read)
-
-        if os.path.isfile(path):
-            os.remove(path)
-
-    def testSaveData1D(self):
-        """
-        Test the 1D file save method
-        """
-        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])
-
-        # Test the .txt format
-        file_name = "test123_out.txt"
-        QtGui.QFileDialog.getSaveFileName = MagicMock(return_value=file_name)
-        data.filename = "test123.txt"
-        saveData1D(data)
-        self.assertTrue(os.path.isfile(file_name))
-        os.remove(file_name)
-
-        # Test the .xml format
-        file_name = "test123_out.xml"
-        QtGui.QFileDialog.getSaveFileName = MagicMock(return_value=file_name)
-        data.filename = "test123.xml"
-        saveData1D(data)
-        self.assertTrue(os.path.isfile(file_name))
-        os.remove(file_name)
-
-        # Test the wrong format
-        file_name = "test123_out.mp3"
-        QtGui.QFileDialog.getSaveFileName = MagicMock(return_value=file_name)
-        data.filename = "test123.mp3"
-        saveData1D(data)
-        self.assertFalse(os.path.isfile(file_name))
-
-    def testSaveData2D(self):
-        """
-        Test the 1D file save method
-        """
-        data = Data2D(image=[1.0, 2.0, 3.0],
-                      err_image=[0.01, 0.02, 0.03],
-                      qx_data=[0.1, 0.2, 0.3],
-                      qy_data=[0.1, 0.2, 0.3])
-
-        # Test the .txt format
-        file_name = "test123_out.dat"
-        QtGui.QFileDialog.getSaveFileName = MagicMock(return_value=file_name)
-        data.filename = "test123.dat"
-        saveData2D(data)
-        self.assertTrue(os.path.isfile(file_name))
-        os.remove(file_name)
-
-        # Test the wrong format
-        file_name = "test123_out.mp3"
-        QtGui.QFileDialog.getSaveFileName = MagicMock(return_value=file_name)
-        data.filename = "test123.mp3"
-        saveData2D(data)
-        self.assertFalse(os.path.isfile(file_name))
-
-    def testXYTransform(self):
-        """ Assure the unit/legend transformation is correct"""
-        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])
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="y")
-        self.assertEqual(xLabel, "()")
-        self.assertEqual(xscale, "linear")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x^(2)", yLabel="1/y")
-        self.assertEqual(xLabel, "^{2}(()^{2})")
-        self.assertEqual(yLabel, "1/(()^{-1})")
-        self.assertEqual(xscale, "linear")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x^(4)", yLabel="ln(y)")
-        self.assertEqual(xLabel, "^{4}(()^{4})")
-        self.assertEqual(yLabel, "\\ln{()}()")
-        self.assertEqual(xscale, "linear")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="ln(x)", yLabel="y^(2)")
-        self.assertEqual(xLabel, "\\ln{()}()")
-        self.assertEqual(yLabel, "^{2}(()^{2})")
-        self.assertEqual(xscale, "linear")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="log10(x)", yLabel="y*x^(2)")
-        self.assertEqual(xLabel, "()")
-        self.assertEqual(yLabel, " \\ \\ ^{2}(()^{2})")
-        self.assertEqual(xscale, "log")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="log10(x^(4))", yLabel="y*x^(4)")
-        self.assertEqual(xLabel, "^{4}(()^{4})")
-        self.assertEqual(yLabel, " \\ \\ ^{4}(()^{16})")
-        self.assertEqual(xscale, "log")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="1/sqrt(y)")
-        self.assertEqual(yLabel, "1/\\sqrt{}(()^{-0.5})")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="log10(y)")
-        self.assertEqual(yLabel, "()")
-        self.assertEqual(yscale, "log")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="ln(y*x)")
-        self.assertEqual(yLabel, "\\ln{( \\ \\ )}()")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="ln(y*x^(2))")
-        self.assertEqual(yLabel, "\\ln ( \\ \\ ^{2})(()^{2})")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="ln(y*x^(4))")
-        self.assertEqual(yLabel, "\\ln ( \\ \\ ^{4})(()^{4})")
-        self.assertEqual(yscale, "linear")
-
-        xLabel, yLabel, xscale, yscale = xyTransform(data, xLabel="x", yLabel="log10(y*x^(4))")
-        self.assertEqual(yLabel, " \\ \\ ^{4}(()^{4})")
-        self.assertEqual(yscale, "log")
-
-class FormulaValidatorTest(unittest.TestCase):
-    """ Test the formula validator """
-    def setUp(self):
-        '''Create the validator'''
-        self.validator = FormulaValidator()
-
-    def tearDown(self):
-        '''Destroy the validator'''
-        self.validator = None
-
-    def testValidateGood(self):
-        """Test a valid Formula """
-        formula_good = "H24O12C4C6N2Pu"
-        self.assertEqual(self.validator.validate(formula_good, 1)[0], QtGui.QValidator.Acceptable)
-
-        formula_good = "(H2O)0.5(D2O)0.5"
-        self.assertEqual(self.validator.validate(formula_good, 1)[0], QtGui.QValidator.Acceptable)
-
-    def testValidateBad(self):
-        """Test a valid Formula """
-        formula_bad = "H24 %%%O12C4C6N2Pu"
-        self.assertRaises(self.validator.validate(formula_bad, 1)[0])
-        self.assertEqual(self.validator.validate(formula_bad, 1)[0], QtGui.QValidator.Intermediate)
-
-        formula_bad = [1]
-        self.assertEqual(self.validator.validate(formula_bad, 1)[0], QtGui.QValidator.Intermediate)
-
-
-if __name__ == "__main__":
-    unittest.main()
-
Index: src/sas/qtgui/UnitTesting/InvariantTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/InvariantTest.py	(revision f721030e66e61dc6279aa8e024da03b25f8e0d42)
+++ 	(revision )
@@ -1,32 +1,0 @@
-import sys
-import unittest
-
-from PyQt4.QtGui import QApplication
-from PyQt4.QtTest import QTest
-from PyQt4.QtCore import Qt
-from new_invariant import InvariantWindow
-
-app = QApplication(sys.argv)
-
-class InvariantTest(unittest.TestCase):
-    '''Test the invariant GUI'''
-    def setUp(self):
-        '''Create the GUI'''
-        self.form = InvariantWindow()
-
-    def test_defaults(self):
-        '''Test the GUI in its default state'''
-        self.assertEqual(self.form.lineEdit_4.text(), "0.0")
-        self.assertEqual(self.form.lineEdit_6.text(), "1.0")
-        self.assertEqual(self.form.pushButton.text(), "Calculate")
-
-        # Class is in the default state even without pressing OK
-        self.assertEqual(self.form._background, 0.0)
-        self.assertEqual(self.form._scale, 1.0)
-        
-        # Push OK with the left mouse button
-        helpButton = self.form.pushButton_3
-        QTest.mouseClick(helpButton, Qt.LeftButton)
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/KiessigCalculatorTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/KiessigCalculatorTest.py	(revision 040529d59cec22934096b06caeb1e05dcbeb7f7f)
+++ 	(revision )
@@ -1,83 +1,0 @@
-import sys
-import unittest
-from PyQt4 import QtGui
-from PyQt4.QtTest import QTest
-from PyQt4.QtCore import Qt
-
-# TEMP
-import path_prepare
-
-
-from KiessigPanel import KiessigPanel
-
-app = QtGui.QApplication(sys.argv)
-
-
-class KiessigCalculatorTest(unittest.TestCase):
-    """Test the KiessigCalculator"""
-    def setUp(self):
-        """Create the KiessigCalculator"""
-        self.widget = KiessigPanel(None)
-
-    def tearDown(self):
-        """Destroy the KiessigCalculator"""
-        self.widget.close()
-        self.widget = None
-
-    def testDefaults(self):
-        """Test the GUI in its default state"""
-        self.assertIsInstance(self.widget, QtGui.QWidget)
-        self.assertEqual(self.widget.windowTitle(), "Kiessig Thickness Calculator")
-        self.assertEqual(self.widget.sizePolicy().Policy(), QtGui.QSizePolicy.Fixed)
-
-    def testHelp(self):
-        """ Assure help file is shown """
-
-        # this should not rise
-        self.widget.onHelp()
-
-    def testComplexEntryNumbers(self):
-        """ User entered compound calculations and subsequent reset"""
-
-        self.widget.deltaq_in.clear()
-        self.widget.deltaq_in.insert('0.05')
-        #
-        # Push Compute with the left mouse button
-        computeButton = self.widget.computeButton
-        QTest.mouseClick(computeButton, Qt.LeftButton)
-        self.assertEqual(self.widget.lengthscale_out.text(), '125.664')
-
-    def testComplexEntryNumbers2(self):
-        """ User entered compound calculations and subsequent reset"""
-
-        self.widget.deltaq_in.clear()
-        self.widget.deltaq_in.insert('1.0')
-        #
-        # Push Compute with the left mouse button
-        computeButton = self.widget.computeButton
-        QTest.mouseClick(computeButton, Qt.LeftButton)
-        self.assertEqual(self.widget.lengthscale_out.text(), '6.283')
-
-    def testComplexEntryNumbers3(self):
-        """ User entered compound calculations and subsequent reset"""
-
-        self.widget.deltaq_in.clear()
-        self.widget.deltaq_in.insert('2.0')
-        #
-        # Push Compute with the left mouse button
-        computeButton = self.widget.computeButton
-        QTest.mouseClick(computeButton, Qt.LeftButton)
-        self.assertEqual(self.widget.lengthscale_out.text(), '3.142')
-
-    def testComplexEntryLetters(self):
-        """ User entered compound calculations and subsequent reset"""
-
-        self.widget.deltaq_in.insert("xyz")
-
-        # Push Compute with the left mouse button
-        computeButton = self.widget.computeButton
-        QTest.mouseClick(computeButton, Qt.LeftButton)
-        self.assertEqual(self.widget.lengthscale_out.text(), '')
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/LinearFitTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/LinearFitTest.py	(revision 2e3e95954828438b02ef55c47cd9553fe9a7a87a)
+++ 	(revision )
@@ -1,148 +1,0 @@
-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.Plotter as Plotter
-
-# Local
-from 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/UnitTesting/MainWindowTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/MainWindowTest.py	(revision 31c5b583d8c577c4ed72be87d22d34ec2ed50c04)
+++ 	(revision )
@@ -1,55 +1,0 @@
-import sys
-import unittest
-
-from PyQt4 import QtGui
-from PyQt4 import QtTest
-from PyQt4 import QtCore
-from mock import MagicMock
-
-# set up import paths
-import path_prepare
-
-# Local
-from MainWindow import MainSasViewWindow
-from MainWindow import SplashScreen
-
-app = QtGui.QApplication(sys.argv)
-
-class MainWindowTest(unittest.TestCase):
-    """Test the Main Window GUI"""
-    def setUp(self):
-        """Create the GUI"""
-
-        self.widget = MainSasViewWindow(None)
-
-    def tearDown(self):
-        """Destroy the GUI"""
-        self.widget = None
-
-    def testDefaults(self):
-        """Test the GUI in its default state"""
-        self.assertIsInstance(self.widget, QtGui.QMainWindow)
-        self.assertIsInstance(self.widget.centralWidget(), QtGui.QWorkspace)
-        
-    def testSplashScreen(self):
-        """ Test the splash screen """
-        splash = SplashScreen()
-        self.assertIsInstance(splash, QtGui.QSplashScreen)
-
-    def testExit(self):
-        """
-        Test that the custom exit method is called on shutdown
-        """
-        # Must mask sys.exit, otherwise the whole testing process stops.
-        sys.exit = MagicMock()
-        QtGui.QMessageBox.question = MagicMock(return_value=QtGui.QMessageBox.Yes)
-
-        # Open, then close the main window
-        tmp_main = MainSasViewWindow(None)
-        tmp_main.close()
-
-        # See that the MessageBox method got called
-        self.assertTrue(QtGui.QMessageBox.question.called)
-       
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/PlotHelperTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/PlotHelperTest.py	(revision 0268aed2269053d708f7e97fbea13db43e371ab4)
+++ 	(revision )
@@ -1,54 +1,0 @@
-import unittest
-
-# Tested module
-import 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/UnitTesting/PlotPropertiesTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/PlotPropertiesTest.py	(revision 0f3c22d6d78f70dfa622751e9a7254328e99bf1c)
+++ 	(revision )
@@ -1,102 +1,0 @@
-import sys
-import unittest
-from mock import MagicMock
-
-from PyQt4 import QtGui
-
-# set up import paths
-import path_prepare
-
-# Local
-from 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/UnitTesting/PlotUtilitiesTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/PlotUtilitiesTest.py	(revision db5cd8da62c5627b9811d209d913219ab45e3c75)
+++ 	(revision )
@@ -1,46 +1,0 @@
-import sys
-import unittest
-from collections import OrderedDict
-
-from UnitTesting.TestUtils import WarningTestNotImplemented
-
-# Tested module
-import 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/UnitTesting/Plotter2DTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/Plotter2DTest.py	(revision 965fbd854b36d33e3c78f5ffed0a6040af2ad43e)
+++ 	(revision )
@@ -1,238 +1,0 @@
-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.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/UnitTesting/PlotterBaseTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/PlotterBaseTest.py	(revision aadf0af183702570addb989ed535f1c04f06b3df)
+++ 	(revision )
@@ -1,194 +1,0 @@
-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.ScaleProperties import ScaleProperties
-from sas.qtgui.WindowTitle import WindowTitle
-#import sas.qtgui.GuiUtils as GuiUtils
-from sas.qtgui.GuiUtils import *
-import sas.qtgui.PlotHelper as PlotHelper
-
-# Tested module
-import sas.qtgui.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/UnitTesting/PlotterTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/PlotterTest.py	(revision 0268aed2269053d708f7e97fbea13db43e371ab4)
+++ 	(revision )
@@ -1,414 +1,0 @@
-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.LinearFit import LinearFit
-from sas.qtgui.PlotProperties import PlotProperties
-
-# Tested module
-import sas.qtgui.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 testOnModifyPlot(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('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)
-
-            #print self.plotter.plot_dict[2].symbol
-
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/SLDCalculatorTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/SLDCalculatorTest.py	(revision 416fa8fe6ed121e335fb8f0e75cdd9a8ab89b80d)
+++ 	(revision )
@@ -1,145 +1,0 @@
-import sys
-import unittest
-import webbrowser
-
-from PyQt4 import QtGui
-from PyQt4.QtTest import QTest
-from PyQt4 import QtCore
-from mock import MagicMock
-
-####### TEMP
-import path_prepare
-#######
-
-# Local
-from SldPanel import SldResult
-from SldPanel import SldPanel
-from SldPanel import sldAlgorithm
-from GuiUtils import FormulaValidator
-
-import LocalConfig
-
-app = QtGui.QApplication(sys.argv)
-
-class SldResultTest(unittest.TestCase):
-    """ Test the simple container class"""
-    def testObjectSize(self):
-        results = SldResult(0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
-                            0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
-        self.assertEqual(sys.getsizeof(results), 56)
-
-
-class SldAlgorithmTest(unittest.TestCase):
-    """ Test the periodictable wrapper """
-    def testSldAlgorithm1(self):
-        molecular_formula = "H2O"
-        mass_density = 1.0
-        wavelength = 6.0
-        
-        results = sldAlgorithm( molecular_formula,
-                                mass_density,
-                                wavelength)
-        self.assertIsInstance(results, SldResult)
-        self.assertAlmostEqual(results.neutron_length, 0.175463, 5)
-        self.assertAlmostEqual(results.neutron_inc_xs, 5.365857, 5)
-        self.assertAlmostEqual(results.neutron_abs_xs, 0.074224, 5)
-
-    def testSldAlgorithm2(self):
-        molecular_formula = "C29O[18]5+7NH[2]3"
-        mass_density = 3.0
-        wavelength = 666.0
-        
-        results = sldAlgorithm( molecular_formula,
-                                mass_density,
-                                wavelength)
-        self.assertIsInstance(results, SldResult)
-        self.assertAlmostEqual(results.neutron_length,   0.059402, 5)
-        self.assertAlmostEqual(results.neutron_inc_xs,   0.145427, 5)
-        self.assertAlmostEqual(results.neutron_abs_xs,  15.512215, 5)
-        self.assertAlmostEqual(results.neutron_sld_real, 1.3352833e-05, 5)
-        self.assertAlmostEqual(results.neutron_sld_imag, 1.1645807e-10, 5)
-
-
-class SLDCalculatorTest(unittest.TestCase):
-    '''Test the SLDCalculator'''
-    def setUp(self):
-        '''Create the SLDCalculator'''
-        self.widget = SldPanel(None)
-
-    def tearDown(self):
-        '''Destroy the DensityCalculator'''
-        self.widget.close()
-        self.widget = None
-
-    def testDefaults(self):
-        '''Test the GUI in its default state'''
-        self.assertIsInstance(self.widget, QtGui.QWidget)
-        self.assertEqual(self.widget.windowTitle(), "SLD Calculator")
-        self.assertIsInstance(self.widget.ui.editMolecularFormula.validator(), FormulaValidator)
-        self.assertEqual(self.widget.ui.editMolecularFormula.styleSheet(), '')
-        self.assertEqual(self.widget.model.columnCount(), 1)
-        self.assertEqual(self.widget.model.rowCount(), 12)
-        self.assertEqual(self.widget.sizePolicy().Policy(), QtGui.QSizePolicy.Fixed)
-
-    def testSimpleEntry(self):
-        ''' Default compound calculations '''
-
-        self.widget.show()
-
-        self.widget.ui.editMassDensity.clear()
-        self.widget.ui.editMassDensity.insert("1.0")
-        # Send tab x3
-        key = QtCore.Qt.Key_Tab
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QtGui.qApp.processEvents()
-        QTest.qWait(100)
-
-        # Assure the output fields are set
-        self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '5.37')
-
-        # Change mass density
-        self.widget.ui.editWavelength.clear()
-        self.widget.ui.editWavelength.setText("666.0")
-
-        # Send shift-tab to update the molar volume field
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QtGui.qApp.processEvents()
-        QTest.qWait(100)
-
-        # Assure the molar volume field got updated
-        self.assertEqual(self.widget.ui.editNeutronAbsXs.text(), '8.24')
-
-    def testComplexEntryAndReset(self):
-        ''' User entered compound calculations and subsequent reset'''
-
-        self.widget.ui.editMolecularFormula.clear()
-        self.widget.ui.editMolecularFormula.insert("CaCO[18]3+6H2O")
-        self.widget.ui.editMassDensity.insert("5.0")
-
-        self.widget.show()
-        # Send tab x2
-        key = QtCore.Qt.Key_Tab
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.keyEvent(QTest.Press, self.widget, key, QtCore.Qt.NoModifier)
-        QTest.qWait(100)
-
-        # Assure the mass density field is set
-        self.assertEqual(self.widget.ui.editNeutronIncXs.text(), '40.6')
-
-        # Reset the widget
-        self.widget.modelReset()
-
-        self.assertEqual(self.widget.ui.editMolecularFormula.text(), "H2O")
-        self.assertEqual(self.widget.ui.editMassDensity.text(), "1")
-        self.assertEqual(self.widget.ui.editWavelength.text(), "6")
-
-    def testHelp(self):
-        """ Assure help file is shown """
-
-        # this should not rise
-        self.widget.displayHelp()
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/SasviewLoggerTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/SasviewLoggerTest.py	(revision 31c5b583d8c577c4ed72be87d22d34ec2ed50c04)
+++ 	(revision )
@@ -1,58 +1,0 @@
-import sys
-import unittest
-import logging
-
-from PyQt4.QtGui import *
-from PyQt4.QtCore import *
-
-# set up import paths
-import path_prepare
-
-# Local
-from SasviewLogger import XStream
-from SasviewLogger import QtHandler
-
-app = QApplication(sys.argv)
-
-class SasviewLoggerTest(unittest.TestCase):
-    def setUp(self):
-        """
-        Prepare the logger
-        """
-        self.logger = logging.getLogger(__name__)
-        handler = QtHandler()
-        handler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
-        self.logger.addHandler(handler)
-        self.logger.setLevel(logging.DEBUG)
-
-        self.outHandlerGui=QTextBrowser()
-
-
-    def testQtHandler(self):
-        """
-        Test redirection of all levels of logging
-        """
-        # Attach the listeners
-        XStream.stderr().messageWritten.connect( self.outHandlerGui.insertPlainText )
-        XStream.stdout().messageWritten.connect( self.outHandlerGui.insertPlainText )
-
-        # Send the signals
-        self.logger.debug('debug message')
-        self.logger.info('info message')
-        self.logger.warning('warning message')
-        self.logger.error('error message')
-        sys.stdout.write('with stdout')
-        sys.stderr.write('with stderr')
-
-        out=self.outHandlerGui.toPlainText()
-
-        # Assure everything got logged
-        self.assertIn('DEBUG: debug message', out)
-        self.assertIn('INFO: info message', out)
-        self.assertIn('WARNING: warning message', out)
-        self.assertIn('ERROR: error message', out)
-        self.assertIn('with stdout', out)
-        self.assertIn('with stderr', out)
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/ScalePropertiesTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/ScalePropertiesTest.py	(revision 6d05e1d115a38b7805a83cb480014af70b58ef75)
+++ 	(revision )
@@ -1,60 +1,0 @@
-import sys
-import unittest
-
-from PyQt4 import QtGui
-
-# set up import paths
-import path_prepare
-
-# Local
-from 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/UnitTesting/SetGraphRangeTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/SetGraphRangeTest.py	(revision d3ca36332a95a5caf23ee8f8223a9c9912826726)
+++ 	(revision )
@@ -1,56 +1,0 @@
-import sys
-import unittest
-
-from PyQt4 import QtGui
-
-# set up import paths
-import path_prepare
-
-# Local
-from 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/UnitTesting/SlicerModelTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/SlicerModelTest.py	(revision 3bdbfcc5cdff8a3a11a9bb19c1cc8c3660a9c2e2)
+++ 	(revision )
@@ -1,77 +1,0 @@
-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 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/UnitTesting/SlicerParametersTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/SlicerParametersTest.py	(revision cf89ccea6959685deabb93ffb245d9b592612e5c)
+++ 	(revision )
@@ -1,110 +1,0 @@
-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 path_prepare
-
-from UnitTesting.TestUtils import QtSignalSpy
-
-# Local
-from 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/UnitTesting/SlitSizeCalculatorTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/SlitSizeCalculatorTest.py	(revision 886d2f2c2f6b63261dcd6876da8bea5382aa8536)
+++ 	(revision )
@@ -1,103 +1,0 @@
-import sys
-import unittest
-from PyQt4 import QtGui
-from PyQt4.QtTest import QTest
-from PyQt4.QtCore import Qt
-from mock import MagicMock
-
-# set up import paths
-import path_prepare
-
-from SlitSizeCalculator import SlitSizeCalculator
-from sas.sascalc.dataloader.loader import Loader
-
-app = QtGui.QApplication(sys.argv)
-
-
-class SlitSizeCalculatorTest(unittest.TestCase):
-    """Test the SlitSizeCalculator"""
-    def setUp(self):
-        """Create the SlitSizeCalculator"""
-        self.widget = SlitSizeCalculator(None)
-
-    def tearDown(self):
-        """Destroy the SlitSizeCalculator"""
-        self.widget.close()
-        self.widget = None
-
-    def testDefaults(self):
-        """Test the GUI in its default state"""
-        self.assertIsInstance(self.widget, QtGui.QWidget)
-        self.assertEqual(self.widget.windowTitle(), "Slit Size Calculator")
-        self.assertEqual(self.widget.sizePolicy().Policy(), QtGui.QSizePolicy.Fixed)
-
-    def testHelp(self):
-        """ Assure help file is shown """
-
-        # this should not rise
-        self.widget.onHelp()
-
-    def testBrowseButton(self):
-        browseButton = self.widget.browseButton
-
-        filename = "beam_profile.DAT"
-
-        # Return no files.
-        QtGui.QFileDialog.getOpenFileName = MagicMock(return_value=None)
-
-        # Click on the Browse button
-        QTest.mouseClick(browseButton, Qt.LeftButton)
-
-        # Test the getOpenFileName() dialog called once
-        self.assertTrue(QtGui.QFileDialog.getOpenFileName.called)
-        QtGui.QFileDialog.getOpenFileName.assert_called_once()
-
-        # Now, return a single file
-        QtGui.QFileDialog.getOpenFileName = MagicMock(return_value=filename)
-
-        # Click on the Load button
-        QTest.mouseClick(browseButton, Qt.LeftButton)
-        QtGui.qApp.processEvents()
-
-        # Test the getOpenFileName() dialog called once
-        self.assertTrue(QtGui.QFileDialog.getOpenFileName.called)
-        QtGui.QFileDialog.getOpenFileName.assert_called_once()
-
-
-    def testCalculateSlitSize(self):
-        """ Test slit size calculated value """
-
-        filename = "beam_profile.DAT"
-        loader = Loader()
-        data = loader.load(filename)
-
-        self.widget.calculateSlitSize(data)
-        # The value "5.5858" was obtained by manual calculation.
-        # It turns out our slit length is FWHM/2
-        self.assertAlmostEqual(float(self.widget.slit_length_out.text()), 5.5858/2, 3)
-
-    def testWrongInput(self):
-        """ Test on wrong input data """
-
-        filename = "Dec07031.ASC"
-        loader = Loader()
-        data = loader.load(filename)
-        self.assertRaisesRegexp(RuntimeError,
-                                "Slit Length cannot be computed for 2D Data",
-                                self.widget.calculateSlitSize, data)
-
-        filename = "empty_file.txt"
-        loader = Loader()
-        data = loader.load(filename)
-        self.assertRaisesRegexp(RuntimeError,
-                                "ERROR: Data hasn't been loaded correctly",
-                                self.widget.calculateSlitSize, data)
-
-        data = None
-        self.assertRaisesRegexp(RuntimeError,
-                                "ERROR: Data hasn't been loaded correctly",
-                                self.widget.calculateSlitSize, data)
-
-
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/TestUtilsTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/TestUtilsTest.py	(revision 5032ea687fa17c1323c1124c0a7aa9d80184bf0b)
+++ src/sas/qtgui/UnitTesting/TestUtilsTest.py	(revision 83eb5208b8acb86b064162274de583670f72da47)
@@ -8,6 +8,6 @@
 
 # Local
-from GuiUtils import Communicate
-from UnitTesting.TestUtils import *
+from sas.qtgui.Utilities.GuiUtils import Communicate
+from sas.qtgui.UnitTesting.TestUtils import *
 
 app = QApplication(sys.argv)
Index: src/sas/qtgui/UnitTesting/WelcomePanelTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/WelcomePanelTest.py	(revision adf81b86561ec1880ff7c8551a89a4175e4486d1)
+++ 	(revision )
@@ -1,41 +1,0 @@
-import sys
-import unittest
-
-from PyQt4 import QtGui
-
-# set up import paths
-import path_prepare
-
-# Local
-from WelcomePanel import WelcomePanel
-
-app = QtGui.QApplication(sys.argv)
-
-class WelcomePanelTest(unittest.TestCase):
-    '''Test the WelcomePanel'''
-    def setUp(self):
-        '''Create the WelcomePanel'''
-
-        self.widget = WelcomePanel(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(), "Welcome")
-        
-    def testVersion(self):
-        '''Test the version string'''
-        version = self.widget.lblVersion
-        self.assertIsInstance(version, QtGui.QLabel)
-
-        self.assertIn("SasView", version.text())
-        self.assertIn("Build:", version.text())
-        self.assertIn("UTK, UMD, NIST, ORNL, ISIS, ESS, ILL and ANSTO", version.text())
-       
-if __name__ == "__main__":
-    unittest.main()
Index: src/sas/qtgui/UnitTesting/WindowTitleTest.py
===================================================================
--- src/sas/qtgui/UnitTesting/WindowTitleTest.py	(revision 27313b77c4e5bef362a7502a76baa9340a740ae8)
+++ 	(revision )
@@ -1,46 +1,0 @@
-import sys
-import unittest
-
-from PyQt4 import QtGui
-
-# set up import paths
-import path_prepare
-
-# Local
-from 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")
-        # Retrieve value
-        new_title = self.widget.title()
-        # Check
-        self.assertEqual(new_title, "5 elephants")
-       
-if __name__ == "__main__":
-    unittest.main()
