Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2012 Edward d'Auvergne # 4 # # 5 # This file is part of the program relax (http://www.nmr-relax.com). # 6 # # 7 # This program is free software: you can redistribute it and/or modify # 8 # it under the terms of the GNU General Public License as published by # 9 # the Free Software Foundation, either version 3 of the License, or # 10 # (at your option) any later version. # 11 # # 12 # This program is distributed in the hope that it will be useful, # 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of # 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 15 # GNU General Public License for more details. # 16 # # 17 # You should have received a copy of the GNU General Public License # 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. # 19 # # 20 ############################################################################### 21 22 # Module docstring. 23 """GUI tests for the Bruker Dynamics Center support.""" 24 25 # Python module imports. 26 from os import sep 27 28 # relax module imports. 29 from data import Relax_data_store; ds = Relax_data_store() 30 import dep_check 31 from generic_fns.mol_res_spin import spin_loop 32 from relax_errors import RelaxError 33 from status import Status; status = Status() 34 from test_suite.gui_tests.base_classes import GuiTestCase 35 from test_suite import system_tests 36 37 # relax GUI imports. 38 from gui.interpreter import Interpreter; interpreter = Interpreter() 39 from gui.string_conv import str_to_gui 40 4143 """Class for testing the Bruker Dynamics Center support in the GUI.""" 4413146 """Set up the test case class for the system tests.""" 47 48 # Force execution of the GuiTestCase __init__ method. 49 GuiTestCase.__init__(self, methodName)50 5153 """Set up for all the GUI tests.""" 54 55 # Run the GuiTestCase setup. 56 GuiTestCase.setUp(self) 57 58 # Create a data pipe. 59 self.interpreter.pipe.create('mf', 'mf')60 6163 """Test the reading of a DC file, catching bug #20152 (https://web.archive.org/web/https://gna.org/bugs/?20152).""" 64 65 # Simulate the new analysis wizard. 66 self.app.gui.analysis.menu_new(None) 67 page = self.app.gui.analysis.new_wizard.wizard.get_page(0) 68 page.select_mf(None) 69 page.analysis_name.SetValue(str_to_gui("Model-free test")) 70 self.app.gui.analysis.new_wizard.wizard._go_next(None) 71 page = self.app.gui.analysis.new_wizard.wizard.get_page(1) 72 self.app.gui.analysis.new_wizard.wizard._go_next(None) 73 74 # Get the data. 75 analysis_type, analysis_name, pipe_name, pipe_bundle = self.app.gui.analysis.new_wizard.get_data() 76 77 # Set up the analysis. 78 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) 79 80 # Alias the analysis. 81 analysis = self.app.gui.analysis.get_page_from_name("Model-free test") 82 83 # Change the results directory. 84 analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir)) 85 86 # Launch the spin viewer window. 87 self.app.gui.show_tree() 88 89 # Spin loading wizard: Initialisation. 90 self.app.gui.spin_viewer.load_spins_wizard() 91 92 # Spin loading wizard: The PDB file. 93 page = self.app.gui.spin_viewer.wizard.get_page(0) 94 page.selection = 'new pdb' 95 self.app.gui.spin_viewer.wizard._go_next() 96 page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) 97 page.uf_args['file'].SetValue(str_to_gui(status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'structures' + sep + '1UBQ_H_trunc.pdb')) 98 self.app.gui.spin_viewer.wizard._go_next() 99 interpreter.flush() # Required because of the asynchronous uf call. 100 101 # Spin loading wizard: The spin loading. 102 self.app.gui.spin_viewer.wizard._go_next() 103 interpreter.flush() # Required because of the asynchronous uf call. 104 105 # Close the spin viewer window. 106 self.app.gui.spin_viewer.handler_close() 107 108 # Flush the interpreter in preparation for the synchronous user functions of the peak list wizard. 109 interpreter.flush() 110 111 # The data path. 112 data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'sphere' + sep 113 114 # Set up the Bruker DC wizard. 115 analysis.relax_data.wizard_bruker(None) 116 117 # The spectrum. 118 page = analysis.relax_data.wizard.get_page(analysis.relax_data.page_indices['read']) 119 page.uf_args['ri_id'].SetValue(str_to_gui('r1_700')) 120 page.uf_args['file'].SetValue(str_to_gui(status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'bruker_files' + sep + 'T1_demo_1UBQ_H_trunc.txt')) 121 122 # Catch the failure. 123 try: 124 error = False 125 analysis.relax_data.wizard._go_next(None) 126 except RelaxError: 127 error = True 128 129 # Assert that the RelaxError has occurred. 130 self.assertEqual(error, True)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 10 14:40:01 2013 | http://epydoc.sourceforge.net |