Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2008,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 # Python module imports. 23 from unittest import TestCase 24 25 # relax module imports. 26 from prompt.interpreter import Interpreter 27 from lib.errors import RelaxIntError, RelaxStrError, RelaxStrFileError 28 29 # Unit test imports. 30 from test_suite.unit_tests._prompt.data_types import DATA_TYPES 31 3234 """Unit tests for the functions of the 'prompt.noe' module.""" 3516637 """Set up the test case class for the system tests.""" 38 39 # Execute the base __init__ methods. 40 super(Test_noe, self).__init__(methodName) 41 42 # Load the interpreter. 43 self.interpreter = Interpreter(show_script=False, raise_relax_error=True) 44 self.interpreter.populate_self() 45 self.interpreter.on(verbose=False) 46 47 # Alias the user function class. 48 self.noe_fns = self.interpreter.noe49 5052 """The file arg test of the noe.read_restraints() user function.""" 53 54 # Loop over the data types. 55 for data in DATA_TYPES: 56 # Catch the file and str arguments, and skip them. 57 if data[0] in ['file', 'str']: 58 continue 59 60 # The argument test. 61 self.assertRaises(RelaxStrFileError, self.noe_fns.read_restraints, file=data[1])62 6365 """The dir arg test of the noe.read_restraints() user function.""" 66 67 # Loop over the data types. 68 for data in DATA_TYPES: 69 # Catch the None and str arguments, and skip them. 70 if data[0] == 'None' or data[0] == 'str': 71 continue 72 73 # The argument test. 74 self.assertRaises(RelaxStrError, self.noe_fns.read_restraints, file='noes', dir=data[1])75 7678 """The proton1_col arg test of the noe.read_restraints() user function.""" 79 80 # Loop over the data types. 81 for data in DATA_TYPES: 82 # Catch the None, int, and bin arguments, and skip them. 83 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 84 continue 85 86 # The argument test. 87 self.assertRaises(RelaxIntError, self.noe_fns.read_restraints, file='noes', proton1_col=data[1])88 8991 """The proton2_col arg test of the noe.read_restraints() user function.""" 92 93 # Loop over the data types. 94 for data in DATA_TYPES: 95 # Catch the None, int, and bin arguments, and skip them. 96 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 97 continue 98 99 # The argument test. 100 self.assertRaises(RelaxIntError, self.noe_fns.read_restraints, file='noes', proton2_col=data[1])101 102104 """The lower_col arg test of the noe.read_restraints() user function.""" 105 106 # Loop over the data types. 107 for data in DATA_TYPES: 108 # Catch the int and bin arguments, and skip them. 109 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 110 continue 111 112 # The argument test. 113 self.assertRaises(RelaxIntError, self.noe_fns.read_restraints, file='noes', lower_col=data[1])114 115117 """The upper_col arg test of the noe.read_restraints() user function.""" 118 119 # Loop over the data types. 120 for data in DATA_TYPES: 121 # Catch the int and bin arguments, and skip them. 122 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 123 continue 124 125 # The argument test. 126 self.assertRaises(RelaxIntError, self.noe_fns.read_restraints, file='noes', upper_col=data[1])127 128130 """The sep arg test of the noe.read_restraints() user function.""" 131 132 # Loop over the data types. 133 for data in DATA_TYPES: 134 # Catch the None and str arguments, and skip them. 135 if data[0] == 'None' or data[0] == 'str': 136 continue 137 138 # The argument test. 139 self.assertRaises(RelaxStrError, self.noe_fns.read_restraints, file='noes', sep=data[1])140 141143 """The spectrum_type arg test of the noe.spectrum_type() user function.""" 144 145 # Loop over the data types. 146 for data in DATA_TYPES: 147 # Catch the str argument, and skip it. 148 if data[0] == 'str': 149 continue 150 151 # The argument test. 152 self.assertRaises(RelaxStrError, self.noe_fns.spectrum_type, spectrum_type=data[1])153 154156 """The spectrum_id arg test of the noe.spectrum_type() user function.""" 157 158 # Loop over the data types. 159 for data in DATA_TYPES: 160 # Catch the str argument, and skip it. 161 if data[0] == 'str': 162 continue 163 164 # The argument test. 165 self.assertRaises(RelaxStrError, self.noe_fns.spectrum_type, spectrum_type='x', spectrum_id=data[1])
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 8 10:45:23 2024 | http://epydoc.sourceforge.net |