mailr4248 - /1.3/test_suite/unit_tests/_prompt/test_value.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 02, 2008 - 15:17:
Author: bugman
Date: Wed Jan  2 15:09:46 2008
New Revision: 4248

URL: http://svn.gna.org/viewcvs/relax?rev=4248&view=rev
Log:
Bug fix for the param arg unit test of the value.set() user function.

Lists are now properly checked.


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=4248&r1=4247&r2=4248&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/_prompt/test_value.py (original)
+++ 1.3/test_suite/unit_tests/_prompt/test_value.py Wed Jan  2 15:09:46 2008
@@ -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, RelaxListFloatError, 
RelaxNoneFloatListError, RelaxNoneStrError, RelaxNoneStrListError
+from relax_errors import RelaxError, RelaxListFloatError, RelaxListStrError, 
RelaxNoneFloatListError, RelaxNoneStrError, RelaxNoneStrListError
 from test_suite.unit_tests.value_testing_base import Value_base_class
 
 # Unit test imports.
@@ -74,11 +74,19 @@
             if data[0] == 'None' or data[0] == 'str':
                 continue
 
-            # Catch the list arguments.
-            if data[0] == 'list':
-                self.assertRaises(RelaxListFloatError, self.value_fns.set, 
param=data[1], val=None)
+            # Catch the string list arguments.
+            if data[0] == 'str list':
+                self.assertRaises(RelaxError, self.value_fns.set, 
param=data[1], val=1.0)
+                if len(data[1]) != 1:
+                    self.assertRaises(RelaxError, self.value_fns.set, 
param=data[1], val=[1.0])
+                else:
+                    self.assertRaises(RelaxError, self.value_fns.set, 
param=data[1], val=[1.0, 2.0])
 
-            # The argument test.
+            # Catch all other list arguments.
+            elif type(data[1]) == list:
+                self.assertRaises(RelaxListStrError, self.value_fns.set, 
param=data[1], val=None)
+
+            # All other arguments.
             else:
                 self.assertRaises(RelaxNoneStrListError, self.value_fns.set, 
param=data[1], val=None)
 




Related Messages


Powered by MHonArc, Updated Wed Jan 02 15:20:27 2008