Author: bugman Date: Mon Apr 14 15:32:07 2008 New Revision: 5681 URL: http://svn.gna.org/viewcvs/relax?rev=5681&view=rev Log: Created a unit test for testing the proper operation of the spin loop with wildcard spin selection. 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=5681&r1=5680&r2=5681&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:32:07 2008 @@ -922,6 +922,32 @@ self.assertEqual(i, 7) + def test_spin_loop_wildcard(self): + """Test the proper operation of the spin loop with wildcard spin selection. + + 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('@N*'): + # 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_tokenise1(self): """Test the generic_fns.selection.tokenise() function on the string '@1'."""