Author: bugman Date: Sat Nov 24 12:07:46 2007 New Revision: 3876 URL: http://svn.gna.org/viewcvs/relax?rev=3876&view=rev Log: Added a unit test for the proper operation of the residue loop when no data is present. 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=3876&r1=3875&r2=3876&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 Sat Nov 24 12:07:46 2007 @@ -322,6 +322,24 @@ self.assertEqual(len(list(selection.residue_loop('#Ap4Aase:Glu'))), 1) + def test_residue_loop_no_data(self): + """Test the proper operation of the residue loop when no data is present. + + The function tested is generic_fns.selection.residue_loop(). + """ + + # Reset. + relax_data_store.__reset__() + + # Loop over the residues. + i = 0 + for residue in selection.residue_loop(): + i = i + 1 + + # Test loop length. + self.assertEqual(i, 0) + + def test_residue_loop_no_selection(self): """Test the proper operation of the residue loop when no selection is present.