Author: bugman Date: Sun Nov 11 12:19:14 2007 New Revision: 3468 URL: http://svn.gna.org/viewcvs/relax?rev=3468&view=rev Log: Added a unit test for copying spin data between data pipes. 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=3468&r1=3467&r2=3468&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:19:14 2007 @@ -138,3 +138,28 @@ self.assertEqual(relax_data_store['orig'].mol[0].res[1].spin[0].num, 111) self.assertEqual(relax_data_store['orig'].mol[0].res[1].spin[0].num, 'C8') self.assertEqual(relax_data_store['orig'].mol[0].res[1].spin[0].x, 1) + + + def test_copy_between_pipes(self): + """Test the copying of the spin data between different data pipes. + + The function used is generic_fns.spin.copy(). + """ + + # Set up the data. + self.setup_data() + + # Copy the spin data. + spin.copy(spin_from='#Old mol:1@111', pipe_to='test') + + # Change the first spin's data. + relax_data_store['orig'].mol[0].res[0].spin[0].num = 222 + relax_data_store['orig'].mol[0].res[0].spin[0].x = 2 + + # Test the original spin. + self.assertEqual(relax_data_store['orig'].mol[0].res[0].spin[0].num, 222) + self.assertEqual(relax_data_store['orig'].mol[0].res[0].spin[0].x, 2) + + # Test the new spin. + self.assertEqual(relax_data_store['test'].mol[0].res[0].spin[0].num, 111) + self.assertEqual(relax_data_store['test'].mol[0].res[0].spin[0].x, 1)