Package test_suite :: Package unit_tests :: Package _prompt :: Module test_relax_disp
[hide private]
[frames] | no frames]

Source Code for Module test_suite.unit_tests._prompt.test_relax_disp

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2008-2014 Edward d'Auvergne                                   # 
  4  # Copyright (C) 2009 Sebastien Morin                                          # 
  5  #                                                                             # 
  6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  7  #                                                                             # 
  8  # This program is free software: you can redistribute it and/or modify        # 
  9  # it under the terms of the GNU General Public License as published by        # 
 10  # the Free Software Foundation, either version 3 of the License, or           # 
 11  # (at your option) any later version.                                         # 
 12  #                                                                             # 
 13  # This program is distributed in the hope that it will be useful,             # 
 14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 16  # GNU General Public License for more details.                                # 
 17  #                                                                             # 
 18  # You should have received a copy of the GNU General Public License           # 
 19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 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 lib.errors import RelaxNoneNumError, RelaxStrError 
 29   
 30  # Unit test imports. 
 31  from test_suite.unit_tests._prompt.data_types import DATA_TYPES 
 32   
 33   
34 -class Test_relax_disp(TestCase):
35 """Unit tests for the functions of the 'prompt.relax_disp' module.""" 36
37 - def __init__(self, methodName=None):
38 """Set up the test case class for the system tests.""" 39 40 # Execute the base __init__ methods. 41 super(Test_relax_disp, self).__init__(methodName) 42 43 # Load the interpreter. 44 self.interpreter = Interpreter(show_script=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.relax_disp_fns = self.interpreter.relax_disp
50 51
53 """The cpmg_frq arg test of the relax_disp.cpmg_setup() user function.""" 54 55 # Loop over the data types. 56 for data in DATA_TYPES: 57 # Catch the float, int and None arguments, and skip them. 58 if data[0] == 'float' or data[0] == 'int' or data[0] == 'None': 59 continue 60 61 # The argument test. 62 self.assertRaises(RelaxNoneNumError, self.relax_disp_fns.cpmg_setup, spectrum_id='test', cpmg_frq=data[1])
63 64
66 """The spectrum_id arg test of the relax_disp.cpmg_setup() user function.""" 67 68 # Loop over the data types. 69 for data in DATA_TYPES: 70 # Catch the str arguments, and skip them. 71 if data[0] == 'str': 72 continue 73 74 # The argument test. 75 self.assertRaises(RelaxStrError, self.relax_disp_fns.cpmg_setup, spectrum_id=data[1])
76 77
79 """The exp_type arg test of the relax_disp.exp_type() user function.""" 80 81 # Loop over the data types. 82 for data in DATA_TYPES: 83 # Catch the str arguments, and skip them. 84 if data[0] == 'str': 85 continue 86 87 # The argument test. 88 self.assertRaises(RelaxStrError, self.relax_disp_fns.exp_type, exp_type=data[1])
89 90
92 """The model arg test of the relax_disp.select_model() user function.""" 93 94 # Loop over the data types. 95 for data in DATA_TYPES: 96 # Catch the str arguments, and skip them. 97 if data[0] == 'str': 98 continue 99 100 # The argument test. 101 self.assertRaises(RelaxStrError, self.relax_disp_fns.select_model, model=data[1])
102