Author: bugman Date: Mon Apr 17 09:18:41 2006 New Revision: 2478 URL: http://svn.gna.org/viewcvs/relax?rev=2478&view=rev Log: Added tests for setting the CSA and bond length in model-free analysis to the test suite. Modified: 1.2/test_suite/model_free.py 1.2/test_suite/test_suite.py Modified: 1.2/test_suite/model_free.py URL: http://svn.gna.org/viewcvs/relax/1.2/test_suite/model_free.py?rev=2478&r1=2477&r2=2478&view=diff ============================================================================== --- 1.2/test_suite/model_free.py (original) +++ 1.2/test_suite/model_free.py Mon Apr 17 09:18:41 2006 @@ -44,6 +44,22 @@ # The test. self.test = self.read_results + + # Test of setting the CSA. + if test_name == 'set csa': + # The name of the test. + self.name = "Setting the CSA value through the user function value.set()" + + # The test. + self.test = self.set_csa + + # Test of setting the bond length. + if test_name == 'set bond length': + # The name of the test. + self.name = "Setting the bond length through the user function value.set()" + + # The test. + self.test = self.set_csa def read_relax_data(self, run): @@ -258,3 +274,55 @@ """Function for printing a residue mismatch.""" print "The " + name + " of " + self.orig_res + " and " + self.new_res + " do not match." + + + def set_bond_length(self, run): + """Testing the setting of the bond length.""" + + # Arguments. + self.run = run + + # Create the run. + self.relax.generic.runs.create(self.run, 'mf') + + # Path of the files. + path = sys.path[-1] + '/test_suite/data/model_free/S2_0.970_te_2048_Rex_0.149' + + # Read the sequence. + self.relax.interpreter._Sequence.read(self.run, file='noe.500.out', dir=path) + + # Set the CSA value. + self.relax.interpreter._Value.set(self.run, 1.02 * 1e-10, 'bond_length') + + # Test the value. + if self.relax.data.res[self.run][1].r != 1.02 * 1e-10: + print "The bond length has not been set correctly." + return + + return 1 + + + def set_csa(self, run): + """Testing the setting of the CSA value.""" + + # Arguments. + self.run = run + + # Create the run. + self.relax.generic.runs.create(self.run, 'mf') + + # Path of the files. + path = sys.path[-1] + '/test_suite/data/model_free/S2_0.970_te_2048_Rex_0.149' + + # Read the sequence. + self.relax.interpreter._Sequence.read(self.run, file='noe.500.out', dir=path) + + # Set the CSA value. + self.relax.interpreter._Value.set(self.run, -170 * 1e-6, 'csa') + + # Test the value. + if self.relax.data.res[self.run][1].csa != -170*1e-6: + print "The CSA value has not been set correctly." + return + + return 1 Modified: 1.2/test_suite/test_suite.py URL: http://svn.gna.org/viewcvs/relax/1.2/test_suite/test_suite.py?rev=2478&r1=2477&r2=2478&view=diff ============================================================================== --- 1.2/test_suite/test_suite.py (original) +++ 1.2/test_suite/test_suite.py Mon Apr 17 09:18:41 2006 @@ -135,6 +135,8 @@ # User function results.read() test. self.mf_test_array.append(Mf(self.relax, 'read relaxation data')) self.mf_test_array.append(Mf(self.relax, 'read results')) + self.mf_test_array.append(Mf(self.relax, 'set csa')) + self.mf_test_array.append(Mf(self.relax, 'set bond length')) # Execute the tests. self.exec_tests(self.mf_test_array)