mailr4245 - /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 - 14:51:
Author: bugman
Date: Wed Jan  2 14:51:28 2008
New Revision: 4245

URL: http://svn.gna.org/viewcvs/relax?rev=4245&view=rev
Log:
Updated the val arg unit test of the value.set() user function.

The unit test now properly checks the arg when a list is passed into it.


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=4245&r1=4244&r2=4245&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 14:51:28 2008
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007 Edward d'Auvergne                                       
 #
+# Copyright (C) 2007-2008 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -26,7 +26,7 @@
 # relax module imports.
 from data import Data as relax_data_store
 from prompt.value import Value
-from relax_errors import RelaxListFloatError, RelaxNoneFloatListError, 
RelaxNoneStrError, RelaxNoneStrListError
+from relax_errors import RelaxError, RelaxListFloatError, 
RelaxNoneFloatListError, RelaxNoneStrError, RelaxNoneStrListError
 from test_suite.unit_tests.value_testing_base import Value_base_class
 
 # Unit test imports.
@@ -50,11 +50,17 @@
             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':
+            # Catch all number lists.
+            if data[0] == 'int list' or data[0] == 'float list' or data[0] 
== 'number list':
+                self.assertRaises(RelaxError, self.value_fns.set, 
val=data[1], param='CSA')
+                if len(data[1]) != 1:
+                    self.assertRaises(RelaxError, self.value_fns.set, 
val=data[1], param=['CSA'])
+
+            # Catch all other list arguments.
+            if type(data[1]) == list:
                 self.assertRaises(RelaxListFloatError, self.value_fns.set, 
val=data[1], param=None)
 
-            # The argument test.
+            # All other arguments.
             else:
                 self.assertRaises(RelaxNoneFloatListError, 
self.value_fns.set, val=data[1], param='CSA')
 




Related Messages


Powered by MHonArc, Updated Wed Jan 02 15:00:30 2008