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

Source Code for Module test_suite.gui_tests.dead_uf_pages

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2012-2013 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 catching dead user function pages.""" 
24   
25  # Python module imports. 
26  import sys 
27   
28  # relax module imports. 
29  from lib.errors import RelaxNoPipeError 
30  from test_suite.gui_tests.base_classes import GuiTestCase 
31   
32  # relax GUI imports. 
33  from gui.interpreter import Interpreter; interpreter = Interpreter() 
34  from gui.uf_objects import Uf_storage; uf_store = Uf_storage() 
35   
36   
37 -class Dead_uf_pages(GuiTestCase):
38 """Class for testing the failure of user function pages.""" 39
40 - def test_mol_create(self):
41 """Test a failure detected via the molecule.create user function.""" 42 43 # First try to create a molecule (this will fail due to no data pipes being present). 44 try: 45 # Call the object. 46 self._execute_uf(uf_name='molecule.create', mol_name='x', mol_type='protein') 47 except RelaxNoPipeError: 48 instance = sys.exc_info()[1] 49 sys.stderr.write(instance.__str__()) 50 51 # Create a data pipe. 52 self._execute_uf(uf_name='pipe.create', pipe_name='test', pipe_type='mf') 53 54 # Try to create the molecule a second time. 55 self._execute_uf(uf_name='molecule.create', mol_name='x', mol_type='protein') 56 57 # Checks. 58 self.assertEqual(len(cdp.mol), 1) 59 self.assertEqual(cdp.mol[0].name, 'x')
60