Author: bugman Date: Sat Nov 24 12:02:36 2007 New Revision: 3873 URL: http://svn.gna.org/viewcvs/relax?rev=3873&view=rev Log: Added a unit test for the generic_fns.selection.count_spins() function, for when there is no data. 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=3873&r1=3872&r2=3873&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:02:36 2007 @@ -85,6 +85,19 @@ self.assertEqual(selection.count_spins(selection='@N5'), 2) + def test_count_no_spins(self): + """Test that the number of spins (zero) can be properly counted. + + The function tested is generic_fns.selection.count_spins(). + """ + + # Remove all data. + relax_data_store.__reset__() + + # Test the number of spins counted. + self.assertEqual(selection.count_spins(), 0) + + def test_molecule_loop(self): """Test the proper operation of the molecule loop with molecule selection.