mailr3917 - in /1.3: prompt/diffusion_tensor.py test_suite/unit_tests/_prompt/test_diffusion_tensor.py


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

Header


Content

Posted by edward on November 25, 2007 - 17:32:
Author: bugman
Date: Sun Nov 25 17:32:34 2007
New Revision: 3917

URL: http://svn.gna.org/viewcvs/relax?rev=3917&view=rev
Log:
Fixed the params arg unit test for the diffusion_tensor.init() user function.


Modified:
    1.3/prompt/diffusion_tensor.py
    1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py

Modified: 1.3/prompt/diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/diffusion_tensor.py?rev=3917&r1=3916&r2=3917&view=diff
==============================================================================
--- 1.3/prompt/diffusion_tensor.py (original)
+++ 1.3/prompt/diffusion_tensor.py Sun Nov 25 17:32:34 2007
@@ -402,7 +402,7 @@
             raise RelaxNumTupleError, ('diffusion parameters', params)
         if type(params) == tuple:
             if len(params) != 4 and len(params) != 6:
-                raise RelaxError, "The diffusion parameters argument must 
either be a number or a tuple of numbers of length 4 or 6."
+                raise RelaxError, "The diffusion parameters argument " + 
`params` + " must either be a number or a tuple of numbers of length 4 or 6."
             for i in xrange(len(params)):
                 if type(params[i]) != float and type(params[i]) != int:
                     raise RelaxNumTupleError, ('diffusion parameters', 
params)

Modified: 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py?rev=3917&r1=3916&r2=3917&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py (original)
+++ 1.3/test_suite/unit_tests/_prompt/test_diffusion_tensor.py Sun Nov 25 
17:32:34 2007
@@ -79,12 +79,19 @@
 
         # Loop over the data types.
         for data in DATA_TYPES:
-            # Catch the float list arguments, and skip them.
-            if data[0] == 'float tuple':
+            # Catch a single float, int, or bin, and skip them.
+            if data[0] == 'int' or data[0] == 'bin' or data[0] == 'float':
                 continue
 
-            # The argument test.
-            self.assertRaises(RelaxNumTupleError, 
self.diffusion_tensor_fns.init, params=data[1])
+            # Catch the tuple arguments.
+            if data[0] == 'tuple' or data[0] == 'float tuple':
+                # Incorrect tuple length.
+                if len(data[1]) != 4 and len(data[1]) != 6:
+                    self.assertRaises(RelaxError, 
self.diffusion_tensor_fns.init, params=data[1])
+
+                # Must be a number.
+                elif data[0] != 'float tuple':
+                    self.assertRaises(RelaxNumTupleError, 
self.diffusion_tensor_fns.init, params=data[1])
 
 
     def test_init_argfail_time_scale(self):




Related Messages


Powered by MHonArc, Updated Sun Nov 25 17:40:11 2007