Author: bugman Date: Sat Nov 24 20:49:54 2007 New Revision: 3887 URL: http://svn.gna.org/viewcvs/relax?rev=3887&view=rev Log: Wrote 4 unit tests for the generic_fns.selection.exists_mol_res_spin_data() function.
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=3887&r1=3886&r2=3887&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 20:49:54 2007 @@ -114,6 +114,55 @@ self.assertRaises(RelaxNoPipeError, selection.count_spins) + def test_exists_mol_res_spin_data(self): + """Test the function for determining if molecule-residue-spin data exists. + + The function tested is generic_fns.selection.exists_mol_res_spin_data(). + """ + + # This should be True. + self.failUnless(selection.exists_mol_res_spin_data()) + + + def test_exists_mol_res_spin_data_no_data(self): + """Determine if molecule-residue-spin data exists when no data exists. + + The function tested is generic_fns.selection.exists_mol_res_spin_data(). + """ + + # Remove all data. + relax_data_store.__reset__() + + # Add a data pipe to the data store. + relax_data_store.add(pipe_name='orig', pipe_type='mf') + + # This should be False. + self.failIf(selection.exists_mol_res_spin_data()) + + + def test_exists_mol_res_spin_data_no_pipe(self): + """Determine if molecule-residue-spin data exists when no data pipe exists. + + The function tested is generic_fns.selection.exists_mol_res_spin_data(). + """ + + # Remove all data. + relax_data_store.__reset__() + + # This should be False. + self.failIf(selection.exists_mol_res_spin_data()) + + + def test_exists_mol_res_spin_data_no_sel(self): + """Determine if molecule-residue-spin data exists when no spins are selected. + + The function tested is generic_fns.selection.exists_mol_res_spin_data(). + """ + + # This should be False. + self.failIf(selection.exists_mol_res_spin_data(selection=':J')) + + def test_molecule_loop(self): """Test the proper operation of the molecule loop with molecule selection. _______________________________________________ relax (http://nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits