Author: bugman Date: Sat Jan 5 20:25:44 2008 New Revision: 4363 URL: http://svn.gna.org/viewcvs/relax?rev=4363&view=rev Log: Converted all of the angle system/functional tests to the new unittest framework.
Modified: 1.3/test_suite/system_tests/__init__.py 1.3/test_suite/system_tests/angles.py 1.3/test_suite/system_tests/main.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=4363&r1=4362&r2=4363&view=diff ============================================================================== --- 1.3/test_suite/system_tests/__init__.py (original) +++ 1.3/test_suite/system_tests/__init__.py Sat Jan 5 20:25:44 2008 @@ -27,9 +27,10 @@ from test_suite.relax_test_runner import RelaxTestRunner # relax system/functional test module imports. +from angles import Angles +from diffusion_tensor import Diffusion_tensor +from model_free import Mf from test_pipe_create import Test_pipe_create -from model_free import Mf -from diffusion_tensor import Diffusion_tensor __all__ = ['angles', @@ -63,9 +64,10 @@ # Create an array of test suites (add your new TestCase classes here). suite_array = [] + suite_array.append(TestLoader().loadTestsFromTestCase(Angles)) + suite_array.append(TestLoader().loadTestsFromTestCase(Diffusion_tensor)) + suite_array.append(TestLoader().loadTestsFromTestCase(Mf)) suite_array.append(TestLoader().loadTestsFromTestCase(Test_pipe_create)) - suite_array.append(TestLoader().loadTestsFromTestCase(Mf)) - suite_array.append(TestLoader().loadTestsFromTestCase(Diffusion_tensor)) # Add the relax namespace to each TestCase object. for i in xrange(len(suite_array)): Modified: 1.3/test_suite/system_tests/angles.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/angles.py?rev=4363&r1=4362&r2=4363&view=diff ============================================================================== --- 1.3/test_suite/system_tests/angles.py (original) +++ 1.3/test_suite/system_tests/angles.py Sat Jan 5 20:25:44 2008 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2006-2007 Edward d'Auvergne # +# Copyright (C) 2006-2008 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -20,21 +20,32 @@ # # ############################################################################### +# Python module imports. import sys +from unittest import TestCase + +# relax module imports. +from data import Data as relax_data_store -class Angles: - def __init__(self, relax): - """Class for testing the angle calculation function.""" +class Angles(TestCase): + """Class for testing the angle calculation function.""" - self.relax = relax + def setUp(self): + """Set up for all the functional tests.""" - # The name of the test. - self.name = "The user function angles()" + # Create the data pipe. + self.relax.interpreter._Pipe.create('mf', 'mf') - def test(self, pipe): - """The actual test.""" + def tearDown(self): + """Reset the relax data storage object.""" + + relax_data_store.__reset__() + + + def test_angles(self): + """The user function angles().""" # Create the data pipe. self.relax.interpreter._Pipe.create(pipe, 'mf') @@ -50,6 +61,3 @@ # Calculate the angles. self.relax.interpreter._Angles.angles() - - # Success. - return 1 Modified: 1.3/test_suite/system_tests/main.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/main.py?rev=4363&r1=4362&r2=4363&view=diff ============================================================================== --- 1.3/test_suite/system_tests/main.py (original) +++ 1.3/test_suite/system_tests/main.py Sat Jan 5 20:25:44 2008 @@ -28,7 +28,6 @@ from test_suite.formatting import * # Import the tests. -from angles import Angles from generic import Generic from jw_mapping import Jw from model_selection import Modsel @@ -76,22 +75,6 @@ # Execute the tests. self.exec_tests(self.seq_test_array) - - - # Angle calculation tests. - ########################## - - # Heading. - 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. @@ -229,21 +212,6 @@ summary_line(test.name, test.passed) - # Angle calculation tests. - ########################## - - # Heading. - sys.stdout.write("\nAngle calculation tests:\n") - - # Loop over the tests. - for test in self.angles_test_array: - # Synopsis. - global_pass = global_pass and test.passed - - # Print the summary line. - summary_line(test.name, test.passed) - - # Relaxation curve-fitting tests. ################################# _______________________________________________ relax (http://nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits