Author: bugman Date: Sun Dec 9 18:05:13 2007 New Revision: 4147 URL: http://svn.gna.org/viewcvs/relax?rev=4147&view=rev Log: Implemented the val unit test for the value.set() user function. Modified: 1.3/test_suite/unit_tests/_prompt/test_value.py Modified: 1.3/test_suite/unit_tests/_prompt/test_value.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_prompt/test_value.py?rev=4147&r1=4146&r2=4147&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_prompt/test_value.py (original) +++ 1.3/test_suite/unit_tests/_prompt/test_value.py Sun Dec 9 18:05:13 2007 @@ -26,7 +26,7 @@ # relax module imports. from data import Data as relax_data_store from prompt.value import Value -from relax_errors import RelaxError +from relax_errors import RelaxListFloatError, RelaxNoneFloatListError from test_suite.unit_tests.value_testing_base import Value_base_class # Unit test imports. @@ -39,3 +39,21 @@ # Instantiate the user function class. value_fns = Value(fake_relax.fake_instance()) + + + def test_set_argfail_val(self): + """The val arg test of the value.set() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the None, float, int, or bin arguments, and skip them. + if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin' or data[0] == 'float': + continue + + # Catch the list arguments. + if data[0] == 'list': + self.assertRaises(RelaxListFloatError, self.value_fns.set, val=data[1], param=None) + + # The argument test. + else: + self.assertRaises(RelaxNoneFloatListError, self.value_fns.set, val=data[1], param='CSA')