Package test_suite :: Package gui_tests :: Module general
[hide private]
[frames] | no frames]

Source Code for Module test_suite.gui_tests.general

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2014 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  """Generic GUI tests.""" 
24   
25  # relax module imports. 
26  from pipe_control.pipes import cdp_name 
27  from status import Status; status = Status() 
28  from test_suite.gui_tests.base_classes import GuiTestCase 
29   
30  # relax GUI imports. 
31  from gui.string_conv import str_to_gui 
32   
33   
34 -class General(GuiTestCase):
35 """Class for testing general GUI operations.""" 36
38 """Catch U{bug #20479<https://web.archive.org/web/https://gna.org/bugs/?20479>}, the failure to switch pipes when closing non-last tabs.""" 39 40 # NOE tab: Simulate the new analysis wizard. 41 self.app.gui.analysis.menu_new(None) 42 page = self.app.gui.analysis.new_wizard.wizard.get_page(0) 43 page.select_noe(None) 44 page.analysis_name.SetValue(str_to_gui("NOE test")) 45 self.app.gui.analysis.new_wizard.wizard._go_next(None) 46 page = self.app.gui.analysis.new_wizard.wizard.get_page(1) 47 page.pipe_name.SetValue(str_to_gui('noe')) 48 page.pipe_bundle.SetValue(str_to_gui('noe bundle')) 49 self.app.gui.analysis.new_wizard.wizard._go_next(None) 50 51 # NOE tab: Get the data. 52 analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data() 53 54 # NOE tab: Set up the analysis. 55 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) 56 57 # Mf tab: Simulate the new analysis wizard. 58 self.app.gui.analysis.menu_new(None) 59 page = self.app.gui.analysis.new_wizard.wizard.get_page(0) 60 page.select_mf(None) 61 page.analysis_name.SetValue(str_to_gui("Mf test")) 62 self.app.gui.analysis.new_wizard.wizard._go_next(None) 63 page = self.app.gui.analysis.new_wizard.wizard.get_page(1) 64 page.pipe_name.SetValue(str_to_gui('mf')) 65 page.pipe_bundle.SetValue(str_to_gui('mf bundle')) 66 self.app.gui.analysis.new_wizard.wizard._go_next(None) 67 68 # Mf tab: Get the data. 69 analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data() 70 71 # Mf tab: Set up the analysis. 72 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) 73 74 # NOE tab: Switch back. 75 self.app.gui.analysis.switch_page(index=0) 76 77 # NOE tab: Closure. 78 self.app.gui.analysis.delete_analysis(0) 79 80 # Check that the Mf data pipe is now the current pipe. 81 self.assertEqual(cdp_name(), 'mf')
82