Author: bugman Date: Sun Nov 11 12:26:55 2007 New Revision: 3470 URL: http://svn.gna.org/viewcvs/relax?rev=3470&view=rev Log: Added a unit test for various types of failure of copying spin data. Modified: 1.3/test_suite/unit_tests/generic_fns/test_spin.py Modified: 1.3/test_suite/unit_tests/generic_fns/test_spin.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/generic_fns/test_spin.py?rev=3470&r1=3469&r2=3470&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/generic_fns/test_spin.py (original) +++ 1.3/test_suite/unit_tests/generic_fns/test_spin.py Sun Nov 11 12:26:55 2007 @@ -73,6 +73,8 @@ # Create a second residue. cdp.mol[0].res.add_item(2, 'Arg') + cdp.mol[0].res[0].spin[0].num = 78 + cdp.mol[0].res[0].spin[0].name = 'NH' # Create a second molecule. cdp.mol.add_item('New mol') @@ -166,7 +168,7 @@ self.assertEqual(relax_data_store['test'].mol[0].res[0].spin[0].x, 1) - def test_copy_between_pipes_fail_no_pipe(self): + def test_copy_between_pipes_fail(self): """Test the copying of the spin data between different data pipes. The function used is generic_fns.spin.copy(). @@ -180,3 +182,23 @@ + def test_copy_fail(self): + """Test the failure of the copying of the spin data. + + The function used is generic_fns.spin.copy(). + """ + + # Set up the data. + self.setup_data() + + # Copy a non-existent residue (1 Met, @111). + self.assertRaises(RelaxError, spin.copy, spin_from=':Met@111', spin_to=':2,Gly') + + # Copy a non-existent spin (1 Ala, @234). + self.assertRaises(RelaxError, spin.copy, spin_from=':Ala@234', spin_to=':2,Gly') + + # Copy a spin to a number which already exists. + self.assertRaises(RelaxError, spin.copy, spin_from=':1', spin_to=':2@78') + + +