mailr17318 - in /branches/frame_order_testing/test_suite/unit_tests: _prompt/test_align_tensor.py align_tensor_testing_base.py


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

Header


Content

Posted by edward on July 25, 2012 - 14:34:
Author: bugman
Date: Wed Jul 25 14:34:19 2012
New Revision: 17318

URL: http://svn.gna.org/viewcvs/relax?rev=17318&view=rev
Log:
Fixes for the unit tests for the align_tensor.init user function changes.


Modified:
    
branches/frame_order_testing/test_suite/unit_tests/_prompt/test_align_tensor.py
    
branches/frame_order_testing/test_suite/unit_tests/align_tensor_testing_base.py

Modified: 
branches/frame_order_testing/test_suite/unit_tests/_prompt/test_align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/unit_tests/_prompt/test_align_tensor.py?rev=17318&r1=17317&r2=17318&view=diff
==============================================================================
--- 
branches/frame_order_testing/test_suite/unit_tests/_prompt/test_align_tensor.py
 (original)
+++ 
branches/frame_order_testing/test_suite/unit_tests/_prompt/test_align_tensor.py
 Wed Jul 25 14:34:19 2012
@@ -137,12 +137,38 @@
 
         # Loop over the data types.
         for data in DATA_TYPES:
-            # Catch the str argument, and skip it.
-            if data[0] == 'str':
-                continue
-
-            # The argument test.
-            self.assertRaises(RelaxStrError, self.align_tensor_fns.init, 
tensor=data[1])
+            # Catch the None and str arguments, and skip them.
+            if data[0] == 'None' or data[0] == 'str':
+                continue
+
+            # The argument test.
+            self.assertRaises(RelaxNoneStrError, self.align_tensor_fns.init, 
tensor=data[1])
+
+
+    def test_init_argfail_align_id(self):
+        """Failure of the align_id arg of the align_tensor.init() user 
function."""
+
+        # Loop over the data types.
+        for data in DATA_TYPES:
+            # Catch the str argument, and skip it.
+            if data[0] == 'str':
+                continue
+
+            # The argument test.
+            self.assertRaises(RelaxStrError, self.align_tensor_fns.init, 
align_id=data[1])
+
+
+    def test_init_argfail_domain(self):
+        """Failure of the domain arg of the align_tensor.init() user 
function."""
+
+        # Loop over the data types.
+        for data in DATA_TYPES:
+            # Catch the None and str arguments, and skip them.
+            if data[0] == 'None' or data[0] == 'str':
+                continue
+
+            # The argument test.
+            self.assertRaises(RelaxNoneStrError, self.align_tensor_fns.init, 
align_id='Pf1', domain=data[1])
 
 
     def test_init_argfail_params(self):
@@ -157,7 +183,7 @@
                     continue
 
             # The argument test.
-            self.assertRaises(RelaxTupleNumError, 
self.align_tensor_fns.init, tensor='Pf1', params=data[1])
+            self.assertRaises(RelaxTupleNumError, 
self.align_tensor_fns.init, align_id='Pf1', params=data[1])
 
 
     def test_init_argfail_scale(self):
@@ -170,7 +196,7 @@
                 continue
 
             # The argument test.
-            self.assertRaises(RelaxFloatError, self.align_tensor_fns.init, 
tensor='Pf1', params=(0.0, 0.0, 0.0, 0.0, 0.0), scale=data[1])
+            self.assertRaises(RelaxFloatError, self.align_tensor_fns.init, 
align_id='Pf1', params=(0.0, 0.0, 0.0, 0.0, 0.0), scale=data[1])
 
 
     def test_init_argfail_angle_units(self):
@@ -196,7 +222,7 @@
                 continue
 
             # The argument test.
-            self.assertRaises(RelaxIntError, self.align_tensor_fns.init, 
tensor='Pf1', params=(0.0, 0.0, 0.0, 0.0, 0.0), param_types=data[1])
+            self.assertRaises(RelaxIntError, self.align_tensor_fns.init, 
align_id='Pf1', params=(0.0, 0.0, 0.0, 0.0, 0.0), param_types=data[1])
 
 
     def test_init_argfail_errors(self):
@@ -209,14 +235,14 @@
                 continue
 
             # The argument test.
-            self.assertRaises(RelaxBoolError, self.align_tensor_fns.init, 
tensor='Pf1', params=(0.0, 0.0, 0.0, 0.0, 0.0), errors=data[1])
+            self.assertRaises(RelaxBoolError, self.align_tensor_fns.init, 
align_id='Pf1', params=(0.0, 0.0, 0.0, 0.0, 0.0), errors=data[1])
 
 
     def test_matrix_angles_argfail_basis_set(self):
         """The proper failure of the align_tensor.matrix_angles() user 
function for the basis_set argument."""
 
         # Add an alignment tensor.
-        align_tensor.init('a', (0.0, 0.0, 0.0, 0.0, 0.0))
+        align_tensor.init(align_id='a', params=(0.0, 0.0, 0.0, 0.0, 0.0))
 
         # Loop over the data types.
         for data in DATA_TYPES:
@@ -232,7 +258,7 @@
         """The tensors arg unit test of the align_tensor.matrix_angles() 
user function."""
 
         # Add an alignment tensor.
-        align_tensor.init('a', (0.0, 0.0, 0.0, 0.0, 0.0))
+        align_tensor.init(align_id='a', params=(0.0, 0.0, 0.0, 0.0, 0.0))
 
         # Loop over the data types.
         for data in DATA_TYPES:
@@ -299,7 +325,7 @@
         """The proper failure of the align_tensor.svd() user function for 
the basis_set argument."""
 
         # Add an alignment tensor.
-        align_tensor.init('a', (0.0, 0.0, 0.0, 0.0, 0.0))
+        align_tensor.init(align_id='a', params=(0.0, 0.0, 0.0, 0.0, 0.0))
 
         # Loop over the data types.
         for data in DATA_TYPES:
@@ -315,7 +341,7 @@
         """The tensors arg unit test of the align_tensor.svd() user 
function."""
 
         # Add an alignment tensor.
-        align_tensor.init('a', (0.0, 0.0, 0.0, 0.0, 0.0))
+        align_tensor.init(align_id='a', params=(0.0, 0.0, 0.0, 0.0, 0.0))
 
         # Loop over the data types.
         for data in DATA_TYPES:

Modified: 
branches/frame_order_testing/test_suite/unit_tests/align_tensor_testing_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/unit_tests/align_tensor_testing_base.py?rev=17318&r1=17317&r2=17318&view=diff
==============================================================================
--- 
branches/frame_order_testing/test_suite/unit_tests/align_tensor_testing_base.py
 (original)
+++ 
branches/frame_order_testing/test_suite/unit_tests/align_tensor_testing_base.py
 Wed Jul 25 14:34:19 2012
@@ -57,7 +57,7 @@
         """
 
         # Initialise the tensor.
-        self.align_tensor_fns.init(tensor='Pf1', params=(-16.6278, 6.13037, 
7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', param_types=0)
+        self.align_tensor_fns.init(tensor='Pf1', align_id='Pf1', 
params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), scale=1.0, 
angle_units='rad', param_types=0)
 
         # Change the current data pipe.
         pipes.switch('test')
@@ -84,7 +84,7 @@
         """
 
         # Initialise the tensor.
-        self.align_tensor_fns.init(tensor='Pf1', params=(-16.6278, 6.13037, 
7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', param_types=0)
+        self.align_tensor_fns.init(tensor='Pf1', align_id='Pf1', 
params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), scale=1.0, 
angle_units='rad', param_types=0)
 
         # Copy the tensor to the test pipe.
         self.align_tensor_fns.copy(tensor_from='Pf1', pipe_to='test', 
tensor_to='Pf1')
@@ -108,7 +108,7 @@
         """
 
         # Initialise the tensor.
-        self.align_tensor_fns.init(tensor='Pf1', params=(-16.6278, 6.13037, 
7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', param_types=0)
+        self.align_tensor_fns.init(tensor='Pf1', align_id='Pf1', 
params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), scale=1.0, 
angle_units='rad', param_types=0)
 
         # Copy the tensor to the test pipe.
         self.assertRaises(RelaxError, self.align_tensor_fns.copy, 
tensor_from='Pf1', tensor_to='Pf1')
@@ -122,7 +122,7 @@
         """
 
         # Initialise the tensor.
-        self.align_tensor_fns.init(tensor='Pf1', params=(-16.6278, 6.13037, 
7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', param_types=0)
+        self.align_tensor_fns.init(tensor='Pf1', align_id='Pf1', 
params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), scale=1.0, 
angle_units='rad', param_types=0)
 
         # Delete the tensor data.
         self.align_tensor_fns.delete(tensor='Pf1')
@@ -167,7 +167,7 @@
         """
 
         # Initialise the tensor.
-        self.align_tensor_fns.init(tensor='Pf1', params=(-16.6278, 6.13037, 
7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', param_types=0)
+        self.align_tensor_fns.init(tensor='Pf1', align_id='Pf1', 
params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), scale=1.0, 
angle_units='rad', param_types=0)
 
         # Display the alignment tensor.
         self.align_tensor_fns.display(tensor='Pf1')
@@ -206,7 +206,7 @@
         """
 
         # Initialise the tensor.
-        self.assertRaises(RelaxError, self.align_tensor_fns.init, 
tensor='Pf1', params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), 
angle_units='aaa')
+        self.assertRaises(RelaxError, self.align_tensor_fns.init, 
align_id='Pf1', params=(-16.6278, 6.13037, 7.65639, -1.89157, 19.2561), 
angle_units='aaa')
 
 
     def test_init(self):
@@ -220,7 +220,7 @@
         dp = pipes.get_pipe('orig')
 
         # Initialise the tensor.
-        self.align_tensor_fns.init(tensor='Pf1', params=(-16.6278, 6.13037, 
7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', param_types=0)
+        self.align_tensor_fns.init(align_id='Pf1', params=(-16.6278, 
6.13037, 7.65639, -1.89157, 19.2561), scale=1.0, angle_units='rad', 
param_types=0)
 
         # Test the alignment tensor.
         self.assertEqual(dp.align_tensors[0].Sxx, -16.6278)
@@ -241,11 +241,11 @@
         dp = pipes.get_pipe('orig')
 
         # Initialise the 5 tensors.
-        self.align_tensor_fns.init(tensor='1', params=(1, 0, 0, 0, 0))
-        self.align_tensor_fns.init(tensor='2', params=(0, 1, 0, 0, 0))
-        self.align_tensor_fns.init(tensor='3', params=(0, 0, 1, 0, 0))
-        self.align_tensor_fns.init(tensor='4', params=(0, 0, 0, 1, 0))
-        self.align_tensor_fns.init(tensor='5', params=(0, 0, 0, 0, 1))
+        self.align_tensor_fns.init(align_id='1', params=(1, 0, 0, 0, 0))
+        self.align_tensor_fns.init(align_id='2', params=(0, 1, 0, 0, 0))
+        self.align_tensor_fns.init(align_id='3', params=(0, 0, 1, 0, 0))
+        self.align_tensor_fns.init(align_id='4', params=(0, 0, 0, 1, 0))
+        self.align_tensor_fns.init(align_id='5', params=(0, 0, 0, 0, 1))
 
         # Matrix angles.
         self.align_tensor_fns.matrix_angles()
@@ -293,11 +293,11 @@
         dp = pipes.get_pipe('orig')
 
         # Initialise the 5 tensors.
-        self.align_tensor_fns.init(tensor='1', params=(1, 0, 0, 0, 0), 
param_types=0)
-        self.align_tensor_fns.init(tensor='2', params=(0, 1, 0, 0, 0), 
param_types=0)
-        self.align_tensor_fns.init(tensor='3', params=(0, 0, 1, 0, 0), 
param_types=0)
-        self.align_tensor_fns.init(tensor='4', params=(0, 0, 0, 1, 0), 
param_types=0)
-        self.align_tensor_fns.init(tensor='5', params=(0, 0, 0, 0, 1), 
param_types=0)
+        self.align_tensor_fns.init(align_id='1', params=(1, 0, 0, 0, 0), 
param_types=0)
+        self.align_tensor_fns.init(align_id='2', params=(0, 1, 0, 0, 0), 
param_types=0)
+        self.align_tensor_fns.init(align_id='3', params=(0, 0, 1, 0, 0), 
param_types=0)
+        self.align_tensor_fns.init(align_id='4', params=(0, 0, 0, 1, 0), 
param_types=0)
+        self.align_tensor_fns.init(align_id='5', params=(0, 0, 0, 0, 1), 
param_types=0)
 
         # SVD.
         self.align_tensor_fns.svd()




Related Messages


Powered by MHonArc, Updated Thu Jul 26 09:40:02 2012