Author: bugman Date: Wed Jun 29 15:55:14 2011 New Revision: 13303 URL: http://svn.gna.org/viewcvs/relax?rev=13303&view=rev Log: Created a GUI test for the auto R1 analysis. This is not complete yet, and is still checking for NOE data. Added: branches/gui_testing/test_suite/gui_tests/rx.py - copied, changed from r13301, branches/gui_testing/test_suite/gui_tests/noe.py Modified: branches/gui_testing/test_suite/gui_tests/__init__.py Modified: branches/gui_testing/test_suite/gui_tests/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/__init__.py?rev=13303&r1=13302&r2=13303&view=diff ============================================================================== --- branches/gui_testing/test_suite/gui_tests/__init__.py (original) +++ branches/gui_testing/test_suite/gui_tests/__init__.py Wed Jun 29 15:55:14 2011 @@ -33,10 +33,12 @@ # relax GUI test module imports. from noe import Noe +from rx import Rx from test_suite.relax_test_loader import RelaxTestLoader as TestLoader -__all__ = ['noe'] +__all__ = ['noe', + 'rx'] class GUI_test_runner: @@ -76,6 +78,7 @@ # All tests. if not tests: suite_array.append(TestLoader().loadTestsFromTestCase(Noe)) + suite_array.append(TestLoader().loadTestsFromTestCase(Rx)) # Group all tests together. full_suite = TestSuite(suite_array) Copied: branches/gui_testing/test_suite/gui_tests/rx.py (from r13301, branches/gui_testing/test_suite/gui_tests/noe.py) URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/rx.py?p2=branches/gui_testing/test_suite/gui_tests/rx.py&p1=branches/gui_testing/test_suite/gui_tests/noe.py&r1=13301&r2=13303&rev=13303&view=diff ============================================================================== --- branches/gui_testing/test_suite/gui_tests/noe.py (original) +++ branches/gui_testing/test_suite/gui_tests/rx.py Wed Jun 29 15:55:14 2011 @@ -40,11 +40,11 @@ # relax GUI imports. if dep_check.wx_module: from gui.relax_gui import Main -from gui.misc import str_to_gui +from gui.misc import float_to_gui, int_to_gui, str_to_gui -class Noe(TestCase): - """Class for testing various aspects specific to the NOE analysis.""" +class Rx(TestCase): + """Class for testing various aspects specific to the R1 and R2 analyses.""" def setUp(self): """Set up for all the functional tests.""" @@ -72,17 +72,20 @@ self.gui.Destroy() - def test_noe_analysis(self): - """Test the NOE analysis.""" + def test_r1_analysis(self): + """Test the r1 analysis.""" + + # The path to the data files. + data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'curve_fitting' # Directly set up the analysis. - self.gui.analysis.new_analysis(analysis_type='noe', analysis_name="Steady-state NOE test", pipe_name='noe test') + self.gui.analysis.new_analysis(analysis_type='r1', analysis_name="R1 relaxation test", pipe_name='r1 test') # Alias the page. - page = self.gui.analysis.get_page_from_name("Steady-state NOE test") + page = self.gui.analysis.get_page_from_name("R1 relaxation test") # The frequency label. - page.field_nmr_frq.SetValue(str_to_gui('500')) + page.field_nmr_frq.SetValue(str_to_gui('600')) # Change the results directory. page.field_results_dir.SetValue(str_to_gui(ds.tmpdir)) @@ -92,19 +95,46 @@ page.field_sequence.SetValue(str_to_gui(file)) # Unresolved spins. - page.field_unresolved.SetValue(str_to_gui('3')) + page.field_unresolved.SetValue(str_to_gui("3, 11, 18, 19, 23, 31, 42, 44, 54, 66, 82, 92, 94, 99, 101, 113, 124, 126, 136, 141, 145, 147, 332, 345, 346, 358, 361")) - # The reference spectrum. - file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'peak_lists' + sep + 'ref_ave.list' - page.field_ref_noe.SetValue(str_to_gui(file)) + # Spectrum names. + names = [ + 'T2_ncyc1_ave', + 'T2_ncyc1b_ave', + 'T2_ncyc2_ave', + 'T2_ncyc4_ave', + 'T2_ncyc4b_ave', + 'T2_ncyc6_ave', + 'T2_ncyc9_ave', + 'T2_ncyc9b_ave', + 'T2_ncyc11_ave', + 'T2_ncyc11b_ave' + ] - # The sat spectrum. - file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'peak_lists' + sep + 'sat_ave.list' - page.field_sat_noe.SetValue(str_to_gui(file)) + # Number of cycles. + ncyc = [1, + 1, + 2, + 4, + 4, + 6, + 9, + 9, + 11, + 11 + ] - # Set the errors. - page.field_ref_rmsd.SetValue(str_to_gui('3600')) - page.field_sat_rmsd.SetValue(str_to_gui('3000')) + # Set the delay time. + page.peak_intensity.delay_time.SetValue(float_to_gui(0.0176)) + + # Add the spectra and number of cycles. + for i in range(len(names)): + # The spectrum. + file = data_path + sep + names[i] + page.peak_intensity.grid.SetCellValue(i, 0, str_to_gui(file)) + + # The number of cycles. + page.peak_intensity.grid.SetCellValue(i, 1, int_to_gui(ncyc[i])) # Set the proton name. ds.relax_gui.global_setting[3] = 'HN' @@ -147,4 +177,4 @@ i += 1 # Check the created files. - self.assert_(access(ds.tmpdir+sep+'grace'+sep+'noe.agr', F_OK)) + self.assert_(access(ds.tmpdir+sep+'grace'+sep+'r1.agr', F_OK))