mailr25047 - in /trunk/test_suite/unit_tests/_specific_analyses/_relax_disp: test_checks.py test_data.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on August 18, 2014 - 14:21:
Author: tlinnet
Date: Mon Aug 18 14:21:01 2014
New Revision: 25047

URL: http://svn.gna.org/viewcvs/relax?rev=25047&view=rev
Log:
Split the unit test of specific_analyses.relax_disp.checks.get_times() into 
its own unit test file.

Added:
    trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_checks.py
Modified:
    trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_data.py

Added: 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_checks.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_checks.py?rev=25047&view=auto
==============================================================================
--- trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_checks.py 
  (added)
+++ trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_checks.py 
  Mon Aug 18 14:21:01 2014
@@ -0,0 +1,64 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2008-2014 Edward d'Auvergne                                  
 #
+# Copyright (C) 2014 Troels E. Linnet                                        
 #
+#                                                                            
 #
+# This file is part of the program relax (http://www.nmr-relax.com).         
 #
+#                                                                            
 #
+# This program 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 3 of the License, or          
 #
+# (at your option) any later version.                                        
 #
+#                                                                            
 #
+# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.      
 #
+#                                                                            
 #
+###############################################################################
+
+# Python module imports.
+from os import sep
+
+# relax module imports.
+from data_store import Relax_data_store; ds = Relax_data_store()
+from pipe_control import state
+from specific_analyses.relax_disp.checks import get_times
+from status import Status; status = Status()
+from test_suite.unit_tests.base_classes import UnitTestCase
+
+
+class Test_checks(UnitTestCase):
+    """Unit tests for the functions of the 
specific_analyses.relax_disp.checks module."""
+
+    def setUp(self):
+        """Setup some structures for the unit tests."""
+
+        # Create a dispersion data pipe.
+        ds.add(pipe_name='orig', pipe_type='relax_disp')
+
+
+    def test_get_times_cpmg(self):
+        """Unit test of the get_times() function.
+
+        This uses the data of the saved state attached to U{bug 
#21665<https://gna.org/bugs/?21665>}.
+        """
+
+        # Load the state.
+        statefile = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'bug_21665.bz2'
+        state.load_state(statefile, force=True)
+
+        # Check the return of get_times().
+        times = get_times()
+        for exp_type in times:
+            print(times[exp_type])
+            self.assertEqual(len(times[exp_type]), 2)
+
+
+
+
+
+

Modified: 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_data.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_data.py?rev=25047&r1=25046&r2=25047&view=diff
==============================================================================
--- trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_data.py   
  (original)
+++ trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_data.py   
  Mon Aug 18 14:21:01 2014
@@ -28,7 +28,6 @@
 from math import atan, pi
 from pipe_control import state
 from pipe_control.mol_res_spin import get_spin_ids, return_spin
-from specific_analyses.relax_disp.checks import get_times
 from specific_analyses.relax_disp.data import calc_rotating_frame_params, 
count_relax_times, find_intensity_keys, get_curve_type, 
has_exponential_exp_type, loop_exp_frq, loop_exp_frq_offset, 
loop_exp_frq_offset_point, loop_exp_frq_offset_point_time, loop_time, 
return_offset_data, return_spin_lock_nu1
 from status import Status; status = Status()
 from test_suite.unit_tests.base_classes import UnitTestCase
@@ -338,23 +337,6 @@
         self.assertEqual(curve_type, 'fixed time')
 
 
-    def test_get_times_cpmg(self):
-        """Unit test of the get_times() function.
-
-        This uses the data of the saved state attached to U{bug 
#21665<https://gna.org/bugs/?21665>}.
-        """
-
-        # Load the state.
-        statefile = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'bug_21665.bz2'
-        state.load_state(statefile, force=True)
-
-        # Check the return of get_times().
-        times = get_times()
-        for exp_type in times:
-            print(times[exp_type])
-            self.assertEqual(len(times[exp_type]), 2)
-
-
     def test_has_exponential_exp_type_cpmg(self):
         """Unit test of the has_exponential_exp_type() function.
 




Related Messages


Powered by MHonArc, Updated Mon Aug 18 16:40:02 2014