Author: bugman Date: Wed May 2 20:42:08 2012 New Revision: 15881 URL: http://svn.gna.org/viewcvs/relax?rev=15881&view=rev Log: Created the Bmrb.test_bmrb_rw GUI test. This incomplete test is based on the bmrb_rw.py system test script. Added: 1.3/test_suite/gui_tests/bmrb.py Modified: 1.3/test_suite/gui_tests/__init__.py Modified: 1.3/test_suite/gui_tests/__init__.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/gui_tests/__init__.py?rev=15881&r1=15880&r2=15881&view=diff ============================================================================== --- 1.3/test_suite/gui_tests/__init__.py (original) +++ 1.3/test_suite/gui_tests/__init__.py Wed May 2 20:42:08 2012 @@ -29,6 +29,7 @@ from unittest import TestSuite # relax GUI test module imports. +from bmrb import Bmrb from model_free import Mf from noe import Noe from rx import Rx @@ -36,7 +37,8 @@ from test_suite.relax_test_loader import RelaxTestLoader as TestLoader -__all__ = ['model_free', +__all__ = ['bmrb', + 'model_free', 'noe', 'rx', 'state'] @@ -80,6 +82,7 @@ # All tests. if not tests: + suite_array.append(TestLoader().loadTestsFromTestCase(Bmrb)) suite_array.append(TestLoader().loadTestsFromTestCase(Mf)) suite_array.append(TestLoader().loadTestsFromTestCase(Noe)) suite_array.append(TestLoader().loadTestsFromTestCase(Rx)) Added: 1.3/test_suite/gui_tests/bmrb.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/gui_tests/bmrb.py?rev=15881&view=auto ============================================================================== --- 1.3/test_suite/gui_tests/bmrb.py (added) +++ 1.3/test_suite/gui_tests/bmrb.py Wed May 2 20:42:08 2012 @@ -1,0 +1,154 @@ +############################################################################### +# # +# Copyright (C) 2012 Edward d'Auvergne # +# # +# This file is part of the program relax. # +# # +# relax is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# relax is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with relax; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +############################################################################### + +# Module docstring. +"""GUI tests for the BMRB related activities.""" + +# Python module imports. +from os import sep + +# relax module imports. +from generic_fns.pipes import VALID_TYPES +from status import Status; status = Status() +from test_suite.gui_tests.base_classes import GuiTestCase + +# relax GUI imports. +from gui.misc import str_to_gui +from gui import user_functions +from gui.wizard import Wiz_window + + +class Bmrb(GuiTestCase): + """Class for testing the BMRB related functions in the GUI.""" + + + def test_bmrb_rw(self): + """Test the reading and writing of BMRB files. + + This test should match that of the system test script bmrb_rw.py. + """ + + # Create a wizard instance to be used in all user function pages. + wizard = Wiz_window(self.app.gui) + + # Create the data pipe. + pipe_create = user_functions.pipe.Create_page(wizard) + pipe_create.pipe_name.SetValue(str_to_gui('results')) + pipe_create.pipe_type.SetSelection(VALID_TYPES.index('mf')) + pipe_create.on_execute() + + # Read the results. + results_read = user_functions.results.Read_page(wizard) + results_read.file.SetValue(str_to_gui(status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'OMP'+sep+'final_results_trunc_1.3')) + results_read.on_execute() + + # Play with the data. + deselect_all = user_functions.deselect.All_page(wizard) + deselect_all.on_execute() + + spin_copy = user_functions.spin.Copy_page(wizard) + spin_copy.res_from.SetValue(str_to_gui('9 None')) + spin_copy.res_num_to.SetValue(str_to_gui('9')) + spin_copy.spin_name_to.SetValue(str_to_gui('NE')) + spin_copy.on_execute() + + select_spin = user_functions.select.Spin_page(wizard) + select_spin.spin_id.SetValue(str_to_gui(':9')) + select_spin.on_execute() + select_spin.spin_id.SetValue(str_to_gui(':10')) + select_spin.on_execute() + select_spin.spin_id.SetValue(str_to_gui(':11')) + select_spin.on_execute() + + spin_name = user_functions.spin.Name_page(wizard) + spin_name.name.SetValue(str_to_gui('N')) + spin_name.on_execute() + + spin_element = user_functions.spin.Element_page(wizard) + spin_element.spin_id.SetValue(str_to_gui('N')) + spin_element.on_execute() + + #molecule_name = user_functions.molecule.Name_page(wizard) + #molecule_name.name.SetValue(str_to_gui('OMP')) + #molecule_name.type.SetValue(str_to_gui('protein')) + #molecule_name.on_execute() + + #bmrb_thiol_state = user_functions.bmrb.Thiol_state_page(wizard) + #bmrb_thiol_state.state.SetValue(str_to_gui('reduced')) + #bmrb_thiol_state.on_execute() + + # Display the data (as a test). + #relax_data_display = user_functions.relax_data.Display_page(wizard) + #relax_data_display.ri_id.SetValue(str_to_gui('R1_800')) + #relax_data_display.on_execute() + + # Temperature control and peak intensity type. + ri_ids = ['R1_600', 'R2_600', 'NOE_600', 'R1_800', 'R2_800', 'NOE_800'] + for i in range(6): + pass + #relax_data_temp_calibration = user_functions.relax_data.Temp_calibration_page(wizard) + #relax_data_temp_calibration.ri_id.SetValue(str_to_gui(ri_ids[i])) + #relax_data_temp_calibration.method.SetValue(str_to_gui('methanol')) + #relax_data_temp_calibration.on_execute() + + #relax_data_temp_control = user_functions.relax_data.Temp_control_page(wizard) + #relax_data_temp_control.ri_id.SetValue(str_to_gui(ri_ids[i])) + #relax_data_temp_control.method.SetValue(str_to_gui('single fid interleaving')) + #relax_data_temp_control.on_execute() + + #relax_data_peak_intensity_type = user_functions.relax_data.Peak_intensity_type_page(wizard) + #relax_data_peak_intensity_type.ri_id.SetValue(str_to_gui(ri_ids[i])) + #relax_data_peak_intensity_type.type.SetValue(str_to_gui('height')) + #relax_data_peak_intensity_type.on_execute() + + # Set up some BMRB information. + #bmrb_software_select = user_functions.bmrb.Software_select_page(wizard) + #bmrb_software_select.name.SetValue(str_to_gui('NMRPipe')) + #bmrb_software_select.on_execute() + #bmrb_software_select.name.SetValue(str_to_gui('Sparky')) + #bmrb_software_select.version.SetValue(str_to_gui('3.106')) + #bmrb_software_select.on_execute() + + bmrb_citation = user_functions.bmrb.Citation_page(wizard) + bmrb_citation.cite_id.SetValue(str_to_gui('test')) + bmrb_citation.SetValue(key='authors', value=[["Edward", "d'Auvergne", "E.", "J."], ["Paul", "Gooley", "P.", "R."]]) + bmrb_citation.on_execute() + + #bmrb.citation(cite_id='test', authors=[["Edward", "d'Auvergne", "E.", "J."], ["Paul", "Gooley", "P.", "R."]], doi="10.1039/b702202f", pubmed_id="17579774", full_citation="d'Auvergne E. J., Gooley P. R. (2007). Set theory formulation of the model-free problem and the diffusion seeded model-free paradigm. Mol. Biosyst., 3(7), 483-494.", title="Set theory formulation of the model-free problem and the diffusion seeded model-free paradigm.", status="published", type="journal", journal_abbrev="Mol. Biosyst.", journal_full="Molecular Biosystems", volume=3, issue=7, page_first=483, page_last=498, year=2007) + + #bmrb.software(name='X', url='http://www.nmr-relax.com', vendor_name='me', cite_ids=['test'], tasks=['procrastinating', 'nothing much', 'wasting time']) + + #bmrb.script(file='noe.py', dir=status.install_path+sep+'sample_scripts', analysis_type='noe', engine='relax') + #bmrb.script(file='relax_fit.py', dir=status.install_path+sep+'sample_scripts', analysis_type='relax_fit', engine='relax') + #bmrb.script(file='dauvergne_protocol.py', dir=status.install_path+sep+'sample_scripts'+sep+'model_free', analysis_type='mf', model_selection='AIC', engine='relax', model_elim=True, universal_solution=True) + + # Write, then read the data to a new data pipe. + #bmrb.write(file=ds.tmpfile, dir=None, version=ds.version, force=True) + #pipe.create(pipe_name='new', pipe_type='mf') + #bmrb.read(file=ds.tmpfile, version=ds.version) + + # Display tests. + #sequence.display() + #relax_data.display(ri_id='R1_800') + + # Save the program state. + #state.save('devnull', force=True)