Author: bugman Date: Wed Feb 13 09:12:27 2008 New Revision: 4964 URL: http://svn.gna.org/viewcvs/relax?rev=4964&view=rev Log: Wrote the centre arg unit test for the n_state_model.CoM() user function. Modified: branches/N_state_model/test_suite/unit_tests/_prompt/test_n_state_model.py Modified: branches/N_state_model/test_suite/unit_tests/_prompt/test_n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/test_suite/unit_tests/_prompt/test_n_state_model.py?rev=4964&r1=4963&r2=4964&view=diff ============================================================================== --- branches/N_state_model/test_suite/unit_tests/_prompt/test_n_state_model.py (original) +++ branches/N_state_model/test_suite/unit_tests/_prompt/test_n_state_model.py Wed Feb 13 09:12:27 2008 @@ -38,6 +38,34 @@ # Instantiate the user function class. n_state_model_fns = N_state_model(fake_relax.fake_instance()) + + + def test_CoM_argfail_centre(self): + """The centre arg test of the n_state_model.CoM() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the None arguments, and skip them. + if data[0] == 'None': + continue + + # Catch the list arguments. + if type(data[1]) == list: + # The wrong length. + if len(data[1]) != 3: + self.assertRaises(RelaxLenError, self.n_state_model_fns.CoM, centre=data[1]) + + # Catch the int, float, and number list arguments, and skip them. + elif data[0] == 'int list' or data[0] == 'float list' or data[0] == 'number list': + continue + + # The argument test. + else: + self.assertRaises(RelaxListNumError, self.n_state_model_fns.CoM, centre=data[1]) + + # All other arguments. + else: + self.assertRaises(RelaxListError, self.n_state_model_fns.CoM, centre=data[1]) def test_model_argfail_N(self):