Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2008-2012 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.interpreter import Interpreter 28 from relax_errors import RelaxBoolError, RelaxNoneIntError, RelaxNoneStrError, RelaxStrError, RelaxStrFileError 29 30 # Unit test imports. 31 from data_types import DATA_TYPES 32 3335 """Unit tests for the functions of the 'prompt.select' module.""" 3623238 """Set up the test case class for the system tests.""" 39 40 # Execute the base __init__ methods. 41 super(Test_select, self).__init__(methodName) 42 43 # Load the interpreter. 44 self.interpreter = Interpreter(show_script=False, quit=False, raise_relax_error=True) 45 self.interpreter.populate_self() 46 self.interpreter.on(verbose=False) 47 48 # Alias the user function class. 49 self.select_fns = self.interpreter.select50 5153 """The file arg test of the select.read() user function.""" 54 55 # Loop over the data types. 56 for data in DATA_TYPES: 57 # Catch the str argument, and skip it. 58 if data[0] == 'str' or data[0] == 'file': 59 continue 60 61 # The argument test. 62 self.assertRaises(RelaxStrFileError, self.select_fns.read, file=data[1])63 6466 """The dir arg test of the select.read() user function.""" 67 68 # Loop over the data types. 69 for data in DATA_TYPES: 70 # Catch the None and str arguments, and skip them. 71 if data[0] == 'None' or data[0] == 'str': 72 continue 73 74 # The argument test. 75 self.assertRaises(RelaxNoneStrError, self.select_fns.read, file='unresolved', dir=data[1])76 7779 """The mol_name_col arg test of the select.read() user function.""" 80 81 # Loop over the data types. 82 for data in DATA_TYPES: 83 # Catch the None, int, and bin arguments, and skip them. 84 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 85 continue 86 87 # The argument test. 88 self.assertRaises(RelaxNoneIntError, self.select_fns.read, file='unresolved', mol_name_col=data[1])89 9092 """The res_num_col arg test of the select.read() user function.""" 93 94 # Loop over the data types. 95 for data in DATA_TYPES: 96 # Catch the None, int, and bin arguments, and skip them. 97 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 98 continue 99 100 # The argument test. 101 self.assertRaises(RelaxNoneIntError, self.select_fns.read, file='unresolved', res_num_col=data[1])102 103105 """The res_name_col arg test of the select.read() user function.""" 106 107 # Loop over the data types. 108 for data in DATA_TYPES: 109 # Catch the None, int, and bin arguments, and skip them. 110 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 111 continue 112 113 # The argument test. 114 self.assertRaises(RelaxNoneIntError, self.select_fns.read, file='unresolved', res_name_col=data[1])115 116118 """The spin_num_col arg test of the select.read() user function.""" 119 120 # Loop over the data types. 121 for data in DATA_TYPES: 122 # Catch the None, int, and bin arguments, and skip them. 123 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 124 continue 125 126 # The argument test. 127 self.assertRaises(RelaxNoneIntError, self.select_fns.read, file='unresolved', spin_num_col=data[1])128 129131 """The spin_name_col arg test of the select.read() user function.""" 132 133 # Loop over the data types. 134 for data in DATA_TYPES: 135 # Catch the None, int, and bin arguments, and skip them. 136 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': 137 continue 138 139 # The argument test. 140 self.assertRaises(RelaxNoneIntError, self.select_fns.read, file='unresolved', spin_name_col=data[1])141 142144 """The sep arg test of the select.read() user function.""" 145 146 # Loop over the data types. 147 for data in DATA_TYPES: 148 # Catch the None and str arguments, and skip them. 149 if data[0] == 'None' or data[0] == 'str': 150 continue 151 152 # The argument test. 153 self.assertRaises(RelaxNoneStrError, self.select_fns.read, file='unresolved', sep=data[1])154 155157 """The boolean arg test of the select.read() user function.""" 158 159 # Loop over the data types. 160 for data in DATA_TYPES: 161 # Catch the str argument, and skip it. 162 if data[0] == 'str': 163 continue 164 165 # The argument test. 166 self.assertRaises(RelaxStrError, self.select_fns.read, file='unresolved', boolean=data[1])167 168170 """The change_all arg test of the select.read() user function.""" 171 172 # Loop over the data types. 173 for data in DATA_TYPES: 174 # Catch the bool arguments, and skip them. 175 if data[0] == 'bool': 176 continue 177 178 # The argument test. 179 self.assertRaises(RelaxBoolError, self.select_fns.read, file='unresolved', change_all=data[1])180 181183 """The spin_id arg test of the select.reverse() user function.""" 184 185 # Loop over the data types. 186 for data in DATA_TYPES: 187 # Catch the None and str arguments, and skip them. 188 if data[0] == 'None' or data[0] == 'str': 189 continue 190 191 # The argument test. 192 self.assertRaises(RelaxNoneStrError, self.select_fns.reverse, spin_id=data[1])193 194196 """The spin_id arg test of the select.spin() user function.""" 197 198 # Loop over the data types. 199 for data in DATA_TYPES: 200 # Catch the None and str arguments, and skip them. 201 if data[0] == 'None' or data[0] == 'str': 202 continue 203 204 # The argument test. 205 self.assertRaises(RelaxNoneStrError, self.select_fns.spin, spin_id=data[1])206 207209 """The boolean arg test of the select.spin() user function.""" 210 211 # Loop over the data types. 212 for data in DATA_TYPES: 213 # Catch the str argument, and skip it. 214 if data[0] == 'str': 215 continue 216 217 # The argument test. 218 self.assertRaises(RelaxStrError, self.select_fns.spin, boolean=data[1])219 220222 """The change_all arg test of the select.spin() user function.""" 223 224 # Loop over the data types. 225 for data in DATA_TYPES: 226 # Catch the bool arguments, and skip them. 227 if data[0] == 'bool': 228 continue 229 230 # The argument test. 231 self.assertRaises(RelaxBoolError, self.select_fns.spin, change_all=data[1])
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 10 14:16:50 2013 | http://epydoc.sourceforge.net |