Author: bugman Date: Fri Dec 14 17:11:08 2012 New Revision: 18140 URL: http://svn.gna.org/viewcvs/relax?rev=18140&view=rev Log: Created the Rdc.test_rdc_copy system test to demonstrate the failure of the rdc.copy user function. Modified: trunk/test_suite/system_tests/rdc.py Modified: trunk/test_suite/system_tests/rdc.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/rdc.py?rev=18140&r1=18139&r2=18140&view=diff ============================================================================== --- trunk/test_suite/system_tests/rdc.py (original) +++ trunk/test_suite/system_tests/rdc.py Fri Dec 14 17:11:08 2012 @@ -36,6 +36,46 @@ class Rdc(SystemTestCase): """Class for testing RDC operations.""" + def test_rdc_copy(self): + """Test the operation of the rdc.copy user function.""" + + # Create a data pipe. + self.interpreter.pipe.create('orig', 'N-state') + + # Data directory. + dir = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep + + # Load the spins. + self.interpreter.sequence.read(file='tb.txt', dir=dir, spin_id_col=1) + self.interpreter.sequence.attach_protons() + self.interpreter.sequence.display() + + # Load the RDCs. + self.interpreter.rdc.read(align_id='tb', file='tb.txt', dir=dir, spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4) + self.interpreter.sequence.display() + + # The RDCs. + rdcs = [ -26.2501958629, 9.93081766942, 7.26317614156, -1.24840526981, 5.31803314334, 14.0362909456, 1.33652530397, -1.6021670281] + + # Create a new data pipe by copying the old, then switch to it. + self.interpreter.pipe.copy(pipe_from='orig', pipe_to='new') + self.interpreter.pipe.switch(pipe_name='new') + + # Delete the RDC data. + self.interpreter.rdc.delete() + + # Copy the RDCs. + self.interpreter.rdc.copy(pipe_from='orig', align_id='tb') + + # Checks. + self.assertEqual(count_spins(), 16) + self.assertEqual(len(cdp.interatomic), 8) + i = 0 + for interatom in interatomic_loop(): + self.assertAlmostEqual(rdcs[i], interatom.rdc['tb']) + i += 1 + + def test_rdc_load(self): """Test for the loading of some RDC data with the spin ID format.""" @@ -64,4 +104,3 @@ for interatom in interatomic_loop(): self.assertAlmostEqual(rdcs[i], interatom.rdc['tb']) i += 1 -