Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2007, 2010 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 unittest import TestCase 25 26 # relax module imports. 27 from prompt.spin import Spin 28 from relax_errors import RelaxIntError, RelaxListStrError, RelaxNoneIntError, RelaxNoneStrError, RelaxStrError 29 from test_suite.unit_tests.spin_testing_base import Spin_base_class 30 31 # Unit test imports. 32 from data_types import DATA_TYPES 33 3436 """Unit tests for the functions of the 'prompt.spin' module.""" 37 38 # Instantiate the user function class. 39 spin_fns = Spin() 40 4130043 """Test the proper failure of the spin.copy() user function for the pipe_from argument.""" 44 45 # Loop over the data types. 46 for data in DATA_TYPES: 47 # Catch the None and str arguments, and skip them. 48 if data[0] == 'None' or data[0] == 'str': 49 continue 50 51 # The argument test. 52 self.assertRaises(RelaxNoneStrError, self.spin_fns.copy, pipe_from=data[1], spin_from='#Old mol:1@111', spin_to='#Old mol:2')53 5456 """Test the proper failure of the spin.copy() user function for the spin_from argument.""" 57 58 # Loop over the data types. 59 for data in DATA_TYPES: 60 # Catch the str argument, and skip it. 61 if data[0] == 'str': 62 continue 63 64 # The argument test. 65 self.assertRaises(RelaxStrError, self.spin_fns.copy, spin_from=data[1], spin_to='#Old mol:2')66 6769 """Test the proper failure of the spin.copy() user function for the pipe_to argument.""" 70 71 # Loop over the data types. 72 for data in DATA_TYPES: 73 # Catch the None and str arguments, and skip them. 74 if data[0] == 'None' or data[0] == 'str': 75 continue 76 77 # The argument test. 78 self.assertRaises(RelaxNoneStrError, self.spin_fns.copy, pipe_to=data[1], spin_from='#Old mol:1@111', spin_to='#Old mol:2')79 8082 """Test the proper failure of the spin.copy() user function for the spin_to argument.""" 83 84 # Loop over the data types. 85 for data in DATA_TYPES: 86 # Catch the None and str arguments, and skip them. 87 if data[0] == 'None' or data[0] == 'str': 88 continue 89 90 # The argument test. 91 self.assertRaises(RelaxNoneStrError, self.spin_fns.copy, spin_from='#Old mol:1@111', spin_to=data[1])92 9395 """Test the proper failure of the spin.create() user function for the spin_num argument.""" 96 97 # Loop over the data types. 98 for data in DATA_TYPES: 99 # Catch the int and bin arguments, and skip them. 100 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 101 continue 102 103 # The argument test. 104 self.assertRaises(RelaxNoneIntError, self.spin_fns.create, spin_num=data[1], spin_name='NH')105 106108 """Test the proper failure of the spin.create() user function for the spin_name argument.""" 109 110 # Loop over the data types. 111 for data in DATA_TYPES: 112 # Catch the None and str arguments, and skip them. 113 if data[0] == 'None' or data[0] == 'str': 114 continue 115 116 # The argument test. 117 self.assertRaises(RelaxNoneStrError, self.spin_fns.create, spin_name=data[1], spin_num=1)118 119121 """Test the proper failure of the spin.create() user function for the res_num argument.""" 122 123 # Loop over the data types. 124 for data in DATA_TYPES: 125 # Catch the int and bin arguments, and skip them. 126 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 127 continue 128 129 # The argument test. 130 self.assertRaises(RelaxNoneIntError, self.spin_fns.create, res_num=data[1], spin_name='NH')131 132134 """Test the proper failure of the spin.create() user function for the res_name argument.""" 135 136 # Loop over the data types. 137 for data in DATA_TYPES: 138 # Catch the None and str arguments, and skip them. 139 if data[0] == 'None' or data[0] == 'str': 140 continue 141 142 # The argument test. 143 self.assertRaises(RelaxNoneStrError, self.spin_fns.create, res_name=data[1], spin_num=1, spin_name='NH')144 145147 """Test the proper failure of the spin.create() user function for the mol_name argument.""" 148 149 # Loop over the data types. 150 for data in DATA_TYPES: 151 # Catch the None and str arguments, and skip them. 152 if data[0] == 'None' or data[0] == 'str': 153 continue 154 155 # The argument test. 156 self.assertRaises(RelaxNoneStrError, self.spin_fns.create, mol_name=data[1], spin_num=1, spin_name='NH')157 158160 """The spin_name arg test of the spin.create_pseudo() user function.""" 161 162 # Loop over the data types. 163 for data in DATA_TYPES: 164 # Catch the None and str arguments, and skip them. 165 if data[0] == 'str': 166 continue 167 168 # The argument test. 169 self.assertRaises(RelaxStrError, self.spin_fns.create_pseudo, spin_name=data[1])170 171173 """The spin_num arg test of the spin.create_pseudo() user function.""" 174 175 # Loop over the data types. 176 for data in DATA_TYPES: 177 # Catch the int and bin arguments, and skip them. 178 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 179 continue 180 181 # The argument test. 182 self.assertRaises(RelaxNoneIntError, self.spin_fns.create_pseudo, spin_num=data[1], spin_name='Q')183 184186 """The res_id arg test of the spin.create_pseudo() user function.""" 187 188 # Loop over the data types. 189 for data in DATA_TYPES: 190 # Catch the None and str arguments, and skip them. 191 if data[0] == 'None' or data[0] == 'str': 192 continue 193 194 # The argument test. 195 self.assertRaises(RelaxNoneStrError, self.spin_fns.create_pseudo, res_id=data[1], spin_name='Q')196 197199 """The members arg test of the spin.create_pseudo() user function.""" 200 201 # Loop over the data types. 202 for data in DATA_TYPES: 203 # Catch the str list argument, and skip it. 204 if data[0] == 'str list': 205 continue 206 207 # The argument test. 208 self.assertRaises(RelaxListStrError, self.spin_fns.create_pseudo, members=data[1], spin_name='Q')209 210212 """The averaging arg test of the spin.create_pseudo() user function.""" 213 214 # Loop over the data types. 215 for data in DATA_TYPES: 216 # Catch the str arguments, and skip them. 217 if data[0] == 'str': 218 continue 219 220 # The argument test. 221 self.assertRaises(RelaxStrError, self.spin_fns.create_pseudo, averaging=data[1], spin_name='Q', members=['x'])222 223225 """Test the proper failure of the spin.delete() user function for the spin_id argument.""" 226 227 # Loop over the data types. 228 for data in DATA_TYPES: 229 # Catch the str arguments, and skip them. 230 if data[0] == 'str': 231 continue 232 233 # The argument test. 234 self.assertRaises(RelaxStrError, self.spin_fns.delete, spin_id=data[1])235 236238 """Test the proper failure of the spin.display() user function for the spin_id argument.""" 239 240 # Loop over the data types. 241 for data in DATA_TYPES: 242 # Catch the None and str arguments, and skip them. 243 if data[0] == 'None' or data[0] == 'str': 244 continue 245 246 # The argument test. 247 self.assertRaises(RelaxNoneStrError, self.spin_fns.display, spin_id=data[1])248 249251 """Test the proper failure of the spin.name() user function for the spin_id argument.""" 252 253 # Loop over the data types. 254 for data in DATA_TYPES: 255 # Catch the None and str arguments, and skip them. 256 if data[0] == 'None' or data[0] == 'str': 257 continue 258 259 # The argument test. 260 self.assertRaises(RelaxNoneStrError, self.spin_fns.name, spin_id=data[1])261 262264 """Test the proper failure of the spin.name() user function for the name argument.""" 265 266 # Loop over the data types. 267 for data in DATA_TYPES: 268 # Catch the str arguments, and skip them. 269 if data[0] == 'str': 270 continue 271 272 # The argument test. 273 self.assertRaises(RelaxStrError, self.spin_fns.name, name=data[1])274 275277 """Test the proper failure of the spin.number() user function for the spin_id argument.""" 278 279 # Loop over the data types. 280 for data in DATA_TYPES: 281 # Catch the None and str arguments, and skip them. 282 if data[0] == 'None' or data[0] == 'str': 283 continue 284 285 # The argument test. 286 self.assertRaises(RelaxNoneStrError, self.spin_fns.number, spin_id=data[1])287 288290 """Test the proper failure of the spin.number() user function for the number argument.""" 291 292 # Loop over the data types. 293 for data in DATA_TYPES: 294 # Catch the None, int and bin arguments, and skip them. 295 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 296 continue 297 298 # The argument test. 299 self.assertRaises(RelaxNoneIntError, self.spin_fns.number, spin_id='@111', number=data[1])
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 10 13:32:43 2013 | http://epydoc.sourceforge.net |