Author: bugman Date: Fri Jan 11 10:29:02 2008 New Revision: 4624 URL: http://svn.gna.org/viewcvs/relax?rev=4624&view=rev Log: Wrote unit tests for the new tensors arg of align_tensor.svd() and align_tensor.matrix_angles(). Modified: branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py Modified: branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py?rev=4624&r1=4623&r2=4624&view=diff ============================================================================== --- branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py (original) +++ branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py Fri Jan 11 10:29:02 2008 @@ -26,7 +26,7 @@ # relax module imports. from generic_fns import align_tensor from prompt.align_tensor import Align_tensor -from relax_errors import RelaxError, RelaxBinError, RelaxFloatError, RelaxIntError, RelaxNoneStrError, RelaxNumTupleError, RelaxStrError +from relax_errors import RelaxError, RelaxBinError, RelaxFloatError, RelaxIntError, RelaxListStrError, RelaxNoneStrError, RelaxNumTupleError, RelaxStrError from test_suite.unit_tests.align_tensor_testing_base import Align_tensor_base_class # Unit test imports. @@ -227,6 +227,22 @@ self.assertRaises(RelaxIntError, self.align_tensor_fns.matrix_angles, basis_set=data[1]) + def test_matrix_angles_argfail_basis_tensors(self): + """The tensors arg unit test of the align_tensor.matrix_angles() user function.""" + + # Add an alignment tensor. + align_tensor.init('a', (0.0, 0.0, 0.0, 0.0, 0.0)) + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str list arguments, and skip them. + if data[0] == 'str list': + continue + + # The argument test. + self.assertRaises(RelaxListStrError, self.align_tensor_fns.matrix_angles, tensors=data[1]) + + def test_svd_argfail_basis_set(self): """The proper failure of the align_tensor.svd() user function for the basis_set argument.""" @@ -243,4 +259,19 @@ self.assertRaises(RelaxIntError, self.align_tensor_fns.svd, basis_set=data[1]) - + def test_svd_argfail_basis_tensors(self): + """The tensors arg unit test of the align_tensor.svd() user function.""" + + # Add an alignment tensor. + align_tensor.init('a', (0.0, 0.0, 0.0, 0.0, 0.0)) + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str list arguments, and skip them. + if data[0] == 'str list': + continue + + # The argument test. + self.assertRaises(RelaxListStrError, self.align_tensor_fns.svd, tensors=data[1]) + +