Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2010-2013,2019 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 """Base classes for the system tests.""" 24 25 # Python module imports. 26 from unittest import TestCase 27 28 # relax module imports. 29 from data_store import Relax_data_store; ds = Relax_data_store() 30 from pipe_control.reset import reset 31 from prompt.interpreter import Interpreter 32 from test_suite.clean_up import deletion 33 3436 """The system test base class.""" 379839 """Set up the test case class for the system tests.""" 40 41 # Execute the TestCase __init__ method. 42 super(SystemTestCase, self).__init__(methodName) 43 44 # A string used for classifying skipped tests. 45 if not hasattr(self, '_skip_type'): 46 self._skip_type = 'system' 47 48 # Load the interpreter. 49 self.interpreter = Interpreter(show_script=False, raise_relax_error=True) 50 self.interpreter.populate_self() 51 self.interpreter.on(verbose=False)52 5355 """Execute a relax script within the system test framework. 56 57 @param script: The full path of the script to execute. 58 @type script: str 59 """ 60 61 # Execute the script. 62 self.interpreter.run(script_file=script)63 6466 """Default tearDown operation - delete temp directories and files and reset relax.""" 67 68 # Remove the temporary directory and variable (if there is a deletion failure, continue to allow the test suite to survive). 69 try: 70 deletion(obj=ds, name='tmpdir', dir=True) 71 except: 72 pass 73 try: 74 deletion(obj=self, name='tmpdir', dir=True) 75 except: 76 pass 77 78 # Remove temporary file and variable (if there is a deletion failure, continue to allow the test suite to survive). 79 try: 80 # Close the open file handles on the OS level. 81 close(ds.tmpfile_handle) 82 83 # Delete the temporary files. 84 deletion(obj=ds, name='tmpfile', dir=False) 85 except: 86 pass 87 try: 88 # Close the open file handles on the OS level. 89 close(self.tmpfile_handle) 90 91 # Delete the temporary files. 92 deletion(obj=self, name='tmpfile', dir=False) 93 except: 94 pass 95 96 # Reset relax. 97 reset()
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 8 10:45:36 2024 | http://epydoc.sourceforge.net |