Author: bugman Date: Sun Nov 25 16:43:45 2007 New Revision: 3910 URL: http://svn.gna.org/viewcvs/relax?rev=3910&view=rev Log: Implemented all the arg unit tests for the diffusion_tensor.init() user function.
Modified: 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py Modified: 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py?rev=3910&r1=3909&r2=3910&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py (original) +++ 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py Sun Nov 25 16:43:45 2007 @@ -26,7 +26,7 @@ # relax module imports. from data import Data as relax_data_store from prompt.diffusion_tensor import Diffusion_tensor -from relax_errors import RelaxNumTupleError +from relax_errors import RelaxBinError, RelaxFloatError, RelaxIntError, RelaxNoneStrError, RelaxNumTupleError, RelaxStrError from test_suite.unit_tests.diffusion_tensor_testing_base import Diffusion_tensor_base_class # Unit test imports. @@ -54,4 +54,79 @@ self.assertRaises(RelaxNumTupleError, self.diffusion_tensor_fns.init, params=data[1]) + def test_init_argfail_time_scale(self): + """The time_scale arg test of the diffusion_tensor.init() user function.""" + # Loop over the data types. + for data in DATA_TYPES: + # Catch the float argument, and skip it. + if data[0] == 'float': + continue + + # The argument test. + self.assertRaises(RelaxFloatError, self.diffusion_tensor_fns.init, params=1e-9, time_scale=data[1]) + + + def test_init_argfail_d_scale(self): + """The d_scale arg test of the diffusion_tensor.init() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the float argument, and skip it. + if data[0] == 'float': + continue + + # The argument test. + self.assertRaises(RelaxFloatError, self.diffusion_tensor_fns.init, params=1e-9, d_scale=data[1]) + + + def test_init_argfail_angle_units(self): + """The angle_units arg test of the diffusion_tensor.init() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str argument, and skip it. + if data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxStrError, self.diffusion_tensor_fns.init, params=1e-9, angle_units=data[1]) + + + def test_init_argfail_param_types(self): + """The param_types arg test of the diffusion_tensor.init() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the int and bin arguments, and skip them. + if data[0] == 'int' or data[0] == 'bin': + continue + + # The argument test. + self.assertRaises(RelaxIntError, self.diffusion_tensor_fns.init, params=1e-9, param_types=data[1]) + + + def test_init_argfail_spheroid_type(self): + """The spheroid_type arg test of the diffusion_tensor.init() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the None and str arguments, and skip them. + if data[0] == 'None' or data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxNoneStrError, self.diffusion_tensor_fns.init, params=1e-9, spheroid_type=data[1]) + + + def test_init_argfail_fixed(self): + """The fixed arg test of the diffusion_tensor.init() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the bin arguments, and skip them. + if data[0] == 'bin': + continue + + # The argument test. + self.assertRaises(RelaxBinError, self.diffusion_tensor_fns.init, params=1e-9, fixed=data[1]) _______________________________________________ relax (http://nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits