Author: bugman Date: Wed May 16 12:25:52 2012 New Revision: 16312 URL: http://svn.gna.org/viewcvs/relax?rev=16312&view=rev Log: Created a system test Mol_res_spin.test_residue_delete() demonstrating a failure of the user function. Deleting the first residue removes the entire sequence! Added: 1.3/test_suite/system_tests/mol_res_spin.py Modified: 1.3/test_suite/system_tests/__init__.py Modified: 1.3/test_suite/system_tests/__init__.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/__init__.py?rev=16312&r1=16311&r2=16312&view=diff ============================================================================== --- 1.3/test_suite/system_tests/__init__.py (original) +++ 1.3/test_suite/system_tests/__init__.py Wed May 16 12:25:52 2012 @@ -44,6 +44,7 @@ from model_elimination import Modelim from model_free import Mf from model_selection import Modsel +from mol_res_spin import Mol_res_spin from n_state_model import N_state_model from noe import Noe from noe_restraints import Noe_restraints @@ -145,6 +146,7 @@ suite_array.append(TestLoader().loadTestsFromTestCase(Modelim)) suite_array.append(TestLoader().loadTestsFromTestCase(Mf)) suite_array.append(TestLoader().loadTestsFromTestCase(Modsel)) + suite_array.append(TestLoader().loadTestsFromTestCase(Mol_res_spin)) suite_array.append(TestLoader().loadTestsFromTestCase(N_state_model)) suite_array.append(TestLoader().loadTestsFromTestCase(Noe)) suite_array.append(TestLoader().loadTestsFromTestCase(Noe_restraints)) Added: 1.3/test_suite/system_tests/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/mol_res_spin.py?rev=16312&view=auto ============================================================================== --- 1.3/test_suite/system_tests/mol_res_spin.py (added) +++ 1.3/test_suite/system_tests/mol_res_spin.py Wed May 16 12:25:52 2012 @@ -1,0 +1,64 @@ +############################################################################### +# # +# Copyright (C) 2012 Edward d'Auvergne # +# # +# This file is part of the program relax. # +# # +# relax is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# relax is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with relax; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +############################################################################### + +# Module docstring. +"""System tests of the molecule, residue, and spin sequence operators.""" + + +# Python module imports. +from os import sep + +# relax module imports. +from base_classes import SystemTestCase +from data import Relax_data_store; ds = Relax_data_store() +from status import Status; status = Status() + + +class Mol_res_spin(SystemTestCase): + """Class for testing the mol_res_spin functions.""" + + def setUp(self): + """Set up for all the functional tests.""" + + # Create the data pipe. + self.interpreter.pipe.create('mf', 'mf') + + + def test_residue_delete(self): + """Test residue deletion.""" + + # Read a PDB file. + self.interpreter.structure.read_pdb(file='sphere.pdb', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'sphere') + + # Load the spins. + self.interpreter.structure.load_spins() + + # Test the original sequence data. + self.assertEqual(len(cdp.mol), 1) + self.assertEqual(len(cdp.mol[0].res), 9) + + # Delete the first residue. + self.interpreter.residue.delete(res_id='#sphere_mol1:1&:GLY') + + # Test the remaining sequence data. + self.assertEqual(len(cdp.mol), 1) + self.assertEqual(len(cdp.mol[0].res), 8)