mailRe: r22214 - /trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py


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

Header


Content

Posted by Edward d'Auvergne on February 19, 2014 - 17:33:
Hi Troels,

It would be better to name unit tests something to do with the
function they are testing.  To see the convention used, type:

$ cd test_suite/unit_tests
$ grep "def test" -r .

You will see that it is often the convention that when testing the
function X(), the test name will be test_X_*().  The text at the '*'
position is then a short optional word or two describing what the test
is doing, and is mainly used when there are multiple unit tests of the
same function.  If there is only one test for the X() function, the
test will be simply called test_X().  For more ideas on this, see for
example the cleanly presented
test_suite/unit_tests/align_tensor_testing_base.py file.

Cheers,

Edward

On 19 February 2014 17:23,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Wed Feb 19 17:23:35 2014
New Revision: 22214

URL: http://svn.gna.org/viewcvs/relax?rev=22214&view=rev
Log:
Implemented unit test for catching the correct return of 
loop_exp_frq_offset_point_time.

Regarding bug #21665, (https://gna.org/bugs/?21665) - Running a CPMG 
analysis with two fields at two delay times.

Modified:
    
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py

Modified: 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py?rev=22214&r1=22213&r2=22214&view=diff
==============================================================================
--- 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py
 (original)
+++ 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py
 Wed Feb 19 17:23:35 2014
@@ -38,3 +38,31 @@

         # Create a dispersion data pipe.
         ds.add(pipe_name='orig', pipe_type='relax_disp')
+
+
+    def test_bug_21665_cpmg_two_fields_two_delaytimes_fail_calc(self):
+        """U{Bug #21665<https://gna.org/bugs/?21665>} catch, the failure 
due to a a CPMG analysis recorded at two fields at two delay times, using 
calc()."""
+
+        # 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)
+
+        # Original data
+        ncyc_1 = [20, 16, 10, 36, 2, 12, 4, 22, 18, 40, 14, 26, 8, 32, 24, 
6, 28]
+        sfrq_1 = 499.86214*1E6
+        time_T2_1 = 0.04
+        cpmg_1 = [ncyc/time_T2_1 for ncyc in ncyc_1]
+        cpmg_1.sort()
+
+        ncyc_2 = [28, 4, 32, 60, 2, 10, 16, 8, 20, 52, 18, 40, 6, 12, 24, 
14]
+        sfrq_2 = 599.8908587*1E6
+        time_T2_2 = 0.06
+        cpmg_2 = [ncyc/time_T2_2 for ncyc in ncyc_2]
+        cpmg_2.sort()
+
+        # Test the loop function.
+        for exp_type, frq, offset, point, time, ei, mi, oi, di, ti in 
loop_exp_frq_offset_point_time(return_indices=True):
+            if frq == sfrq_1:
+                self.assertEqual(time, time_T2_1)
+            if frq == sfrq_2:
+                self.assertEqual(time, time_T2_2)


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

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



Related Messages


Powered by MHonArc, Updated Wed Feb 19 18:40:17 2014