Author: bugman Date: Mon Apr 14 18:47:01 2008 New Revision: 5706 URL: http://svn.gna.org/viewcvs/relax?rev=5706&view=rev Log: Wrote the test_spin_loop_single_spin() unit test. 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=5706&r1=5705&r2=5706&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 18:47:01 2008 @@ -1057,6 +1057,31 @@ self.assertEqual(i, 7) + def test_spin_loop_single_spin(self): + """Test the operation of the spin loop with the single spin selection '#Ap4Aase:Glu@63'. + + The function tested is generic_fns.selection.spin_loop(). + """ + + # Loop over the spins. + i = 0 + for spin in selection.spin_loop('#Ap4Aase:Glu@63'): + # Test the selection. + self.assertEqual(spin.select, 1) + + # Test the spin name. + self.assertEqual(spin.name, 'NH') + + # Test the spin number. + self.assertEqual(spin.num, 63) + + # Increment i. + i = i + 1 + + # Test loop length. + self.assertEqual(i, 1) + + def test_spin_loop_wildcard(self): """Test the proper operation of the spin loop with wildcard spin selection '@N*'.