Author: bugman Date: Sat Sep 30 10:08:59 2006 New Revision: 2586 URL: http://svn.gna.org/viewcvs/relax?rev=2586&view=rev Log: Implemented a test for the test suite which catches bug #7224 (https://gna.org/bugs/?7224). Added: 1.2/test_suite/angles.py - copied, changed from r2581, 1.2/test_suite/run_create.py Modified: 1.2/test_suite/test_suite.py Copied: 1.2/test_suite/angles.py (from r2581, 1.2/test_suite/run_create.py) URL: http://svn.gna.org/viewcvs/relax/1.2/test_suite/angles.py?p2=1.2/test_suite/angles.py&p1=1.2/test_suite/run_create.py&r1=2581&r2=2586&rev=2586&view=diff ============================================================================== --- 1.2/test_suite/run_create.py (original) +++ 1.2/test_suite/angles.py Sat Sep 30 10:08:59 2006 @@ -20,15 +20,17 @@ # # ############################################################################### +import sys -class Run_create: + +class Angles: def __init__(self, relax): - """Class for testing the creation of runs.""" + """Class for testing the angle calculation function.""" self.relax = relax # The name of the test. - self.name = "The user function run.create()" + self.name = "The user function angles()" def test(self, run): @@ -37,5 +39,14 @@ # Create the run. self.relax.interpreter._Run.create(run, 'mf') + # Read a PDB file. + self.relax.interpreter._PDB.pdb(run, file='test.pdb', dir=sys.path[-1] + '/test_suite/data', model=1, heteronuc='N', proton='H') + + # Initialise a diffusion tensor. + self.relax.interpreter._Diffusion_tensor.init(run, (1.698e7, 1.417e7, 67.174, -83.718), param_types=3) + + # Calculate the angles. + self.relax.interpreter._Angles.angles(run) + # Success. 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=2586&r1=2585&r2=2586&view=diff ============================================================================== --- 1.2/test_suite/test_suite.py (original) +++ 1.2/test_suite/test_suite.py Sat Sep 30 10:08:59 2006 @@ -26,6 +26,7 @@ # Import the tests. +from angles import Angles from diffusion_tensor import Diffusion_tensor from generic import Generic from jw_mapping import Jw @@ -106,6 +107,22 @@ # Execute the tests. self.exec_tests(self.diff_tensor_test_array) + + + # Angle calculation tests. + ########################## + + # Heading. + self.heading("Angle calculation tests") + + # Initialise the array containing each test element. + self.angles_test_array = [] + + # User function tests. + self.angles_test_array.append(Angles(self.relax)) + + # Execute the tests. + self.exec_tests(self.angles_test_array) # Relaxation curve-fitting tests. @@ -306,6 +323,17 @@ self.summary_line(test) + # Angle calculation tests. + ########################## + + # Heading. + sys.stdout.write("\nAngle calculation tests:\n") + + # Loop over the tests. + for test in self.angles_test_array: + self.summary_line(test) + + # Relaxation curve-fitting tests. #################################