Author: bugman Date: Tue Jul 19 11:29:42 2011 New Revision: 13711 URL: http://svn.gna.org/viewcvs/relax?rev=13711&view=rev Log: Shifted the GUI test startUp() and tearDown() methods into the base class. Modified: branches/gui_testing/test_suite/gui_tests/base_classes.py branches/gui_testing/test_suite/gui_tests/noe.py branches/gui_testing/test_suite/gui_tests/rx.py Modified: branches/gui_testing/test_suite/gui_tests/base_classes.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/base_classes.py?rev=13711&r1=13710&r2=13711&view=diff ============================================================================== --- branches/gui_testing/test_suite/gui_tests/base_classes.py (original) +++ branches/gui_testing/test_suite/gui_tests/base_classes.py Tue Jul 19 11:29:42 2011 @@ -25,13 +25,23 @@ # Python module imports. import Queue -from traceback import print_exception +from shutil import rmtree +from tempfile import mkdtemp from unittest import TestCase +import wx + +# Dependency checks. +import dep_check # relax module imports. +from data import Relax_data_store; ds = Relax_data_store() +from generic_fns.reset import reset from prompt.interpreter import Interpreter from status import Status; status = Status() +# relax GUI imports. +if dep_check.wx_module: + from gui.relax_gui import Main class GuiTestCase(TestCase): """The GUI specific test case.""" @@ -62,3 +72,31 @@ # No exception. except Queue.Empty: pass + + + def setUp(self): + """Set up for all the functional tests.""" + + # Create a temporary directory for the results. + ds.tmpdir = mkdtemp() + + # Start the GUI. + self.app = wx.App() + + # Build the GUI. + self.gui = Main(parent=None, id=-1, title="") + + + def tearDown(self): + """Reset the relax data storage object.""" + + # Remove the temporary directory. + if hasattr(ds, 'tmpdir'): + rmtree(ds.tmpdir) + + # Reset relax. + reset() + + # Destroy the GUI. + if hasattr(self, 'gui'): + self.gui.Destroy() Modified: branches/gui_testing/test_suite/gui_tests/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/noe.py?rev=13711&r1=13710&r2=13711&view=diff ============================================================================== --- branches/gui_testing/test_suite/gui_tests/noe.py (original) +++ branches/gui_testing/test_suite/gui_tests/noe.py Tue Jul 19 11:29:42 2011 @@ -22,26 +22,16 @@ # Python module imports. from os import F_OK, access, sep -import Queue -from shutil import rmtree -from tempfile import mkdtemp -from time import sleep -from traceback import print_exception import wx -# Dependency checks. -import dep_check - # relax module imports. -from base_classes import GuiTestCase from data import Relax_data_store; ds = Relax_data_store() from generic_fns.mol_res_spin import spin_loop from generic_fns.pipes import cdp_name from status import Status; status = Status() +from test_suite.gui_tests.base_classes import GuiTestCase # relax GUI imports. -if dep_check.wx_module: - from gui.relax_gui import Main from gui.misc import int_to_gui, str_to_gui from gui.user_functions import deselect, sequence, spin from gui.wizard import Wiz_window @@ -49,32 +39,6 @@ class Noe(GuiTestCase): """Class for testing various aspects specific to the NOE analysis.""" - - def setUp(self): - """Set up for all the functional tests.""" - - # Create a temporary directory for the results. - ds.tmpdir = mkdtemp() - - # Start the GUI. - self.app = wx.App() - - # Build the GUI. - self.gui = Main(parent=None, id=-1, title="") - - - def tearDown(self): - """Reset the relax data storage object.""" - - # Remove the temporary directory. - rmtree(ds.tmpdir) - - # Reset relax. - reset() - - # Destroy the GUI. - self.gui.Destroy() - def test_noe_analysis(self): """Test the NOE analysis.""" Modified: branches/gui_testing/test_suite/gui_tests/rx.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/rx.py?rev=13711&r1=13710&r2=13711&view=diff ============================================================================== --- branches/gui_testing/test_suite/gui_tests/rx.py (original) +++ branches/gui_testing/test_suite/gui_tests/rx.py Tue Jul 19 11:29:42 2011 @@ -22,57 +22,21 @@ # Python module imports. from os import F_OK, access, sep -import Queue -from shutil import rmtree -from tempfile import mkdtemp -from time import sleep -from traceback import print_exception import wx -# Dependency checks. -import dep_check - # relax module imports. -from base_classes import GuiTestCase from data import Relax_data_store; ds = Relax_data_store() from generic_fns.mol_res_spin import spin_loop from generic_fns.pipes import cdp_name from status import Status; status = Status() +from test_suite.gui_tests.base_classes import GuiTestCase # relax GUI imports. -if dep_check.wx_module: - from gui.relax_gui import Main from gui.misc import float_to_gui, int_to_gui, str_to_gui class Rx(GuiTestCase): """Class for testing various aspects specific to the R1 and R2 analyses.""" - - def setUp(self): - """Set up for all the functional tests.""" - - # Create a temporary directory for the results. - ds.tmpdir = mkdtemp() - - # Start the GUI. - self.app = wx.App() - - # Build the GUI. - self.gui = Main(parent=None, id=-1, title="") - - - def tearDown(self): - """Reset the relax data storage object.""" - - # Remove the temporary directory. - rmtree(ds.tmpdir) - - # Reset relax. - reset() - - # Destroy the GUI. - self.gui.Destroy() - def test_r1_analysis(self): """Test the r1 analysis."""