Author: bugman Date: Sun Jun 16 19:00:41 2013 New Revision: 20159 URL: http://svn.gna.org/viewcvs/relax?rev=20159&view=rev Log: Fixes for the unit tests of the lib.selection module. The contains_*() methods now should be used. And the test_Selection_ful_spin_id() unit test has been completely deleted as this way of checking the selection object is no longer valid. Modified: trunk/test_suite/unit_tests/_lib/test_selection.py Modified: trunk/test_suite/unit_tests/_lib/test_selection.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_lib/test_selection.py?rev=20159&r1=20158&r2=20159&view=diff ============================================================================== --- trunk/test_suite/unit_tests/_lib/test_selection.py (original) +++ trunk/test_suite/unit_tests/_lib/test_selection.py Sun Jun 16 19:00:41 2013 @@ -376,22 +376,6 @@ self.assert_(obj.contains_spin(spin_name='*C*', mol='RNA')) - def test_Selection_full_spin_id(self): - """Test the Selection object for the single spin identifier '#Ap4Aase:2@63'.""" - - # The Selection object. - obj = Selection("#Ap4Aase:2@63") - - # Test if various spins are in the selection. - self.assert_((cdp.mol[0], cdp.mol[0].res[0], cdp.mol[0].res[0].spin[0]) not in obj) - self.assert_((cdp.mol[0], cdp.mol[0].res[1], cdp.mol[0].res[1].spin[0]) in obj) - self.assert_((cdp.mol[0], cdp.mol[0].res[2], cdp.mol[0].res[2].spin[0]) not in obj) - self.assert_((cdp.mol[1], cdp.mol[1].res[0], cdp.mol[1].res[0].spin[0]) not in obj) - self.assert_((cdp.mol[1], cdp.mol[1].res[0], cdp.mol[1].res[0].spin[1]) not in obj) - self.assert_((cdp.mol[1], cdp.mol[1].res[1], cdp.mol[1].res[1].spin[0]) not in obj) - self.assert_((cdp.mol[1], cdp.mol[1].res[1], cdp.mol[1].res[1].spin[1]) not in obj) - - def test_Selection_memory(self): """Test that the Selection object has no memory of previous selections.""" @@ -416,7 +400,7 @@ obj = Selection(":1-70") # Check that the residue ID is in the selection. - self.assert_(':1' in obj) + self.assert_(obj.contains_spin_id(':1')) def test_Selection_range_contains_resid2(self): @@ -426,7 +410,7 @@ obj = Selection(":1-70") # Check that the residue ID is in the selection. - self.assert_(':71' not in obj) + self.assert_(not obj.contains_spin_id(':71')) def test_Selection_range_contains_spinid(self): @@ -436,7 +420,7 @@ obj = Selection(":1-70") # Check that the residue ID is in the selection. - self.assert_(':1@N' in obj) + self.assert_(obj.contains_spin_id(':1@N')) def test_Selection_range_contains_spinid2(self): @@ -446,7 +430,7 @@ obj = Selection(":1-70") # Check that the residue ID is in the selection. - self.assert_(':71@C' not in obj) + self.assert_(not obj.contains_spin_id(':71@C')) def test_parse_token_single_element_num(self):