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

Source Code for Module test_suite.gui_tests.state

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2006-2011 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax.                                     # 
 6  #                                                                             # 
 7  # relax 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 2 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # relax 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 relax; if not, write to the Free Software                        # 
19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # Python module imports. 
24  from os import F_OK, access, sep 
25  import wx 
26   
27  # relax module imports. 
28  from data import Relax_data_store; ds = Relax_data_store() 
29  from generic_fns.mol_res_spin import spin_loop 
30  from generic_fns.pipes import cdp_name 
31  from status import Status; status = Status() 
32  from test_suite.gui_tests.base_classes import GuiTestCase 
33   
34  # relax GUI imports. 
35  from gui.misc import int_to_gui, str_to_gui 
36  from gui.user_functions import deselect, sequence, spin 
37  from gui.wizard import Wiz_window 
38   
39   
40 -class State(GuiTestCase):
41 """Class for testing various aspects specific to saved states.""" 42
43 - def test_load_state_no_gui(self):
44 """Test the loading of a relax save state with no GUI data.""" 45 46 # Simulate the 'Open relax state' menu entry. 47 file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'OMP' + sep + 'final_results_trunc_1.3' 48 self.app.gui.state_load(file_name=file) 49 50 # Show the pipe editor. 51 self.app.gui.show_pipe_editor(None) 52 53 # The menu (this is used to set the selected pipe). 54 self.app.gui.pipe_editor.menu(Fake_grid_cell_right_click()) 55 56 # Associated an auto-analysis with the data pipe. 57 self.app.gui.pipe_editor.associate_auto(None) 58 59 # The index. 60 index = 0 61 62 # Test that the model-free analysis tab is loaded. 63 self.assert_(not self.app.gui.analysis.init_state) 64 self.assertEqual(self.app.gui.analysis._num_analyses, 1) 65 self.assertEqual(len(self.app.gui.analysis._analyses), 1) 66 self.assertEqual(self.app.gui.analysis.notebook.GetPageCount(), 1) 67 self.assert_(self.app.gui.analysis._analyses[index].init_flag) 68 69 # Test the relax data store. 70 self.assert_(hasattr(ds, 'relax_gui')) 71 self.assertEqual(ds.relax_gui.analyses[index].analysis_name, 'Model-free') 72 self.assertEqual(ds.relax_gui.analyses[index].pipe_name, 'a')
73 74 75
76 -class Fake_grid_cell_right_click:
77 """Simulate a grid_cell_right_click event .""" 78
79 - def GetRow(self):
80 """Overwrite the GetRow() method.""" 81 82 # Return the first row. 83 return 0
84