1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 from unittest import TestCase
25
26
27 from prompt.interpreter import Interpreter
28 from relax_errors import RelaxIntError, RelaxListIntError, RelaxNoneIntError, RelaxNoneIntListIntError, RelaxNoneStrError, RelaxNumError, RelaxStrError
29
30
31 from data_types import DATA_TYPES
32
33
35 """Unit tests for the functions of the 'prompt.spectrum' module."""
36
50
51
63
64
66 """The spectrum_id arg test of the spectrum.baseplane_rmsd() user function."""
67
68
69 for data in DATA_TYPES:
70
71 if data[0] == 'str':
72 continue
73
74
75 self.assertRaises(RelaxStrError, self.spectrum_fns.baseplane_rmsd, spectrum_id=data[1])
76
77
89
90
102
103
105 """The spectrum_id arg test of the spectrum.integration_points() user function."""
106
107
108 for data in DATA_TYPES:
109
110 if data[0] == 'str':
111 continue
112
113
114 self.assertRaises(RelaxStrError, self.spectrum_fns.integration_points, N=0, spectrum_id=data[1])
115
116
128
129
131 """The file arg test of the spectrum.read_intensities() user function."""
132
133
134 for data in DATA_TYPES:
135
136 if data[0] == 'str':
137 continue
138
139
140 self.assertRaises(RelaxStrError, self.spectrum_fns.read_intensities, file=data[1])
141
142
144 """The dir arg test of the spectrum.read_intensities() user function."""
145
146
147 for data in DATA_TYPES:
148
149 if data[0] == 'None' or data[0] == 'str':
150 continue
151
152
153 self.assertRaises(RelaxNoneStrError, self.spectrum_fns.read_intensities, file='a', dir=data[1])
154
155
157 """The spectrum_id arg test of the spectrum.read_intensities() user function."""
158
159
160 for data in DATA_TYPES:
161
162 if data[0] == 'str':
163 continue
164
165
166 self.assertRaises(RelaxStrError, self.spectrum_fns.read_intensities, spectrum_id=data[1])
167
168
170 """The heteronuc arg test of the spectrum.read_intensities() user function."""
171
172
173 for data in DATA_TYPES:
174
175 if data[0] == 'str':
176 continue
177
178
179 self.assertRaises(RelaxStrError, self.spectrum_fns.read_intensities, heteronuc=data[1])
180
181
183 """The proton arg test of the spectrum.read_intensities() user function."""
184
185
186 for data in DATA_TYPES:
187
188 if data[0] == 'str':
189 continue
190
191
192 self.assertRaises(RelaxStrError, self.spectrum_fns.read_intensities, proton=data[1])
193
194
196 """The int_col arg test of the spectrum.read_intensities() user function."""
197
198
199 for data in DATA_TYPES:
200
201 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin' or data[0] == 'int list':
202 continue
203
204
205 self.assertRaises(RelaxNoneIntListIntError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_col=data[1])
206
207
209 """The int_method arg test of the spectrum.read_intensities() user function."""
210
211
212 for data in DATA_TYPES:
213
214 if data[0] == 'str':
215 continue
216
217
218 self.assertRaises(RelaxStrError, self.spectrum_fns.read_intensities, int_method=data[1])
219
220
222 """The mol_name_col arg test of the spectrum.read_intensities() user function."""
223
224
225 for data in DATA_TYPES:
226
227 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin':
228 continue
229
230
231 self.assertRaises(RelaxNoneIntError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_method='y', mol_name_col=data[1])
232
233
235 """The res_num_col arg test of the spectrum.read_intensities() user function."""
236
237
238 for data in DATA_TYPES:
239
240 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin':
241 continue
242
243
244 self.assertRaises(RelaxNoneIntError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_method='y', res_num_col=data[1])
245
246
248 """The res_name_col arg test of the spectrum.read_intensities() user function."""
249
250
251 for data in DATA_TYPES:
252
253 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin':
254 continue
255
256
257 self.assertRaises(RelaxNoneIntError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_method='y', res_name_col=data[1])
258
259
261 """The spin_num_col arg test of the spectrum.read_intensities() user function."""
262
263
264 for data in DATA_TYPES:
265
266 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin':
267 continue
268
269
270 self.assertRaises(RelaxNoneIntError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_method='y', spin_num_col=data[1])
271
272
274 """The spin_name_col arg test of the spectrum.read_intensities() user function."""
275
276
277 for data in DATA_TYPES:
278
279 if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin':
280 continue
281
282
283 self.assertRaises(RelaxNoneIntError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_method='y', spin_name_col=data[1])
284
285
287 """The sep arg test of the spectrum.read_intensities() user function."""
288
289
290 for data in DATA_TYPES:
291
292 if data[0] == 'None' or data[0] == 'str':
293 continue
294
295
296 self.assertRaises(RelaxNoneStrError, self.spectrum_fns.read_intensities, file='a', spectrum_id='x', int_method='y', sep=data[1])
297