Author: bugman Date: Sun Apr 20 19:19:29 2008 New Revision: 5867 URL: http://svn.gna.org/viewcvs/relax?rev=5867&view=rev Log: Wrote a unit test for the Scientific_data.__molecule_loop() method with a non-matching selection object. Modified: 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Modified: 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py?rev=5867&r1=5866&r2=5867&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py (original) +++ 1.3/test_suite/unit_tests/_generic_fns/_structure/test_scientific.py Sun Apr 20 19:19:29 2008 @@ -103,6 +103,24 @@ self.assertEqual(mol.sequence(), ['GLY', 'PRO', 'LEU', 'GLY', 'SER', 'MET', 'ASP', 'SER', 'PRO', 'PRO', 'GLU', 'GLY']) + def test___molecule_loop_selection_no_match(self): + """Test the Scientific_data.__molecule_loop() method with a non-matching selection object.""" + + # Load the PDB file. + self.data.load_structures(self.test_pdb_path) + + # Create the non-matching selection object. + sel_obj = Selection('#XXX') + + # Loop over the molecules. + mol_count = 0 + for mol, mol_name, mol_type in self.data._Scientific_data__molecule_loop(self.data.structural_data[0], sel_obj): + mol_count = mol_count + 1 + + # Test the number of molecules looped over. + self.assertEqual(mol_count, 0) + + def test_atom_loop(self): """Test the Scientific_data.atom_loop() method."""