Author: bugman Date: Tue Jan 15 13:09:15 2008 New Revision: 4732 URL: http://svn.gna.org/viewcvs/relax?rev=4732&view=rev Log: Wrote errors arg unit test for the align_tensor.init() user function. This is a new argument to allow the tensor errors to be introduced. 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=4732&r1=4731&r2=4732&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 Tue Jan 15 13:09:15 2008 @@ -159,6 +159,26 @@ self.assertRaises(RelaxNumTupleError, self.align_tensor_fns.init, tensor='Pf1', params=data[1]) + def test_init_argfail_errors(self): + """Failure of the errors arg of the align_tensor.init() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the tuple arguments. + if data[0] == 'tuple' or data[0] == 'float tuple' or data[0] == 'str tuple': + # Incorrect tuple length. + if len(data[1]) != 5: + self.assertRaises(RelaxError, self.align_tensor_fns.init, tensor='Pf1', errors=data[1]) + + # Must be a number. + elif data[0] != 'float tuple': + self.assertRaises(RelaxNumTupleError, self.align_tensor_fns.init, errors=data[1]) + + # The argument test. + else: + self.assertRaises(RelaxNumTupleError, self.align_tensor_fns.init, tensor='Pf1', errors=data[1]) + + def test_init_argfail_scale(self): """The scale arg test of the align_tensor.init() user function."""