mailr3989 - /branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py


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

Header


Content

Posted by edward on November 26, 2007 - 11:51:
Author: bugman
Date: Mon Nov 26 11:51:17 2007
New Revision: 3989

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



Modified:
    branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py

Modified: 
branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py?rev=3989&r1=3988&r2=3989&view=diff
==============================================================================
--- branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py 
(original)
+++ branches/N_state_model/test_suite/unit_tests/_prompt/test_align_tensor.py 
Mon Nov 26 11:51:17 2007
@@ -25,7 +25,7 @@
 
 # relax module imports.
 from prompt.align_tensor import Align_tensor
-from relax_errors import RelaxBinError, RelaxIntError, RelaxNumTupleError
+from relax_errors import RelaxError, RelaxBinError, RelaxIntError, 
RelaxNumTupleError
 from test_suite.unit_tests.align_tensor_testing_base import 
Align_tensor_base_class
 
 # Unit test imports.
@@ -41,16 +41,23 @@
 
 
     def test_init_argfail_params(self):
-        """Test the proper failure of the align_tensor.init() user function 
for the params argument."""
+        """Failure of the params arg of the align_tensor.init() user 
function."""
 
         # Loop over the data types.
         for data in DATA_TYPES:
-            # Catch the float list arguments, and skip them.
-            if data[0] == 'float tuple':
-                continue
+            # Catch the tuple arguments.
+            if data[0] == 'tuple' or data[0] == 'float tuple':
+                # Incorrect tuple length.
+                if len(data[1]) != 5:
+                    self.assertRaises(RelaxError, 
self.align_tensor_fns.init, params=data[1])
+
+                # Must be a number.
+                elif data[0] != 'float tuple':
+                    self.assertRaises(RelaxNumTupleError, 
self.align_tensor_fns.init, params=data[1])
 
             # The argument test.
-            self.assertRaises(RelaxNumTupleError, 
self.align_tensor_fns.init, params=data[1])
+            else:
+                self.assertRaises(RelaxNumTupleError, 
self.align_tensor_fns.init, params=data[1])
 
 
     def test_init_argfail_param_types(self):




Related Messages


Powered by MHonArc, Updated Mon Nov 26 12:00:27 2007