mailr5682 - /1.3/test_suite/unit_tests/_generic_fns/test_selection.py


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

Header


Content

Posted by edward on April 14, 2008 - 15:36:
Author: bugman
Date: Mon Apr 14 15:36:30 2008
New Revision: 5682

URL: http://svn.gna.org/viewcvs/relax?rev=5682&view=rev
Log:
Created a unit test for the proper operation of the spin loop with spin 
selection '@NH|@N5'.


Modified:
    1.3/test_suite/unit_tests/_generic_fns/test_selection.py

Modified: 1.3/test_suite/unit_tests/_generic_fns/test_selection.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_generic_fns/test_selection.py?rev=5682&r1=5681&r2=5682&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/_generic_fns/test_selection.py (original)
+++ 1.3/test_suite/unit_tests/_generic_fns/test_selection.py Mon Apr 14 
15:36:30 2008
@@ -857,6 +857,32 @@
         self.assertEqual(i, 2)
 
 
+    def test_spin_loop_multiatom(self):
+        """Test the proper operation of the spin loop with spin selection 
'@NH|@N5'.
+
+        The function tested is generic_fns.selection.spin_loop().
+        """
+
+        # Spin data.
+        select = [0, 1, 1, 0]
+        name = ['NH', 'NH', 'N5', 'N5']
+
+        # Loop over the spins.
+        i = 0
+        for spin in selection.spin_loop('@NH|@N5'):
+            # Test the selection.
+            self.assertEqual(spin.select, select[i])
+
+            # Test the spin names.
+            self.assertEqual(spin.name, name[i])
+
+            # Increment i.
+            i = i + 1
+
+        # Test loop length.
+        self.assertEqual(i, 4)
+
+
     def test_spin_loop_no_data(self):
         """Test the proper operation of the spin loop when no data is 
present.
 




Related Messages


Powered by MHonArc, Updated Mon Apr 14 15:40:22 2008