Package test_suite :: Package system_tests :: Module consistency_tests
[hide private]
[frames] | no frames]

Source Code for Module test_suite.system_tests.consistency_tests

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2006 Chris MacRaild                                           # 
 4  # Copyright (C) 2007-2008 Sebastien Morin                                     # 
 5  # Copyright (C) 2010-2013 Edward d'Auvergne                                   # 
 6  #                                                                             # 
 7  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 8  #                                                                             # 
 9  # This program is free software: you can redistribute it and/or modify        # 
10  # it under the terms of the GNU General Public License as published by        # 
11  # the Free Software Foundation, either version 3 of the License, or           # 
12  # (at your option) any later version.                                         # 
13  #                                                                             # 
14  # This program is distributed in the hope that it will be useful,             # 
15  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
16  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
17  # GNU General Public License for more details.                                # 
18  #                                                                             # 
19  # You should have received a copy of the GNU General Public License           # 
20  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
21  #                                                                             # 
22  ############################################################################### 
23   
24  # Python module imports. 
25  from os import sep 
26   
27  # relax module imports. 
28  from data_store import Relax_data_store; ds = Relax_data_store() 
29  from pipe_control.mol_res_spin import residue_loop 
30  from lib.physical_constants import N15_CSA 
31  from status import Status; status = Status() 
32  from test_suite.system_tests.base_classes import SystemTestCase 
33   
34   
35 -class Ct(SystemTestCase):
36 """Class for testing various aspects specific to consistency testing.""" 37 38
39 - def setUp(self):
40 """Set up for all the functional tests.""" 41 42 # Create the data pipe. 43 self.interpreter.pipe.create('ct', 'ct')
44 45
47 """Test catching U{bug #20674<https://web.archive.org/web/https://gna.org/bugs/?20674>}, the ct analysis failure submitted by Mengjun Xue.""" 48 49 # Execute the script. 50 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'bug_20674_ct_analysis_failure.py')
51 52
53 - def test_calc(self):
54 """The consistency testing calculation test.""" 55 56 # Execute the script. 57 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests_calc_test.py') 58 59 # Correct consistency functions values. 60 j0 = [4.0703318681008998e-09, 3.7739393907014834e-09] 61 f_eta = [0.20413244790407614, 0.18898977395296815] 62 f_r2 = [2.0482909381655862e-09, 1.8998154021753067e-09] 63 64 # Loop over residues. 65 index = 0 66 for res in residue_loop(): 67 # Residues -2 and -1 have data. 68 if res.num == -2 or res.num == -1: 69 self.assert_(res.spin[0].select) 70 self.assertAlmostEqual(res.spin[0].j0, j0[index]) 71 self.assertAlmostEqual(res.spin[0].f_eta, f_eta[index]) 72 self.assertAlmostEqual(res.spin[0].f_r2, f_r2[index]) 73 index = index + 1 74 75 # Other residues have insufficient data. 76 else: 77 self.assert_(not res.spin[0].select)
78 79
80 - def test_set_value(self):
81 """The user function value.set().""" 82 83 # Execute the script. 84 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests_set_value.py') 85 86 # Loop over residues. 87 for res in residue_loop(): 88 self.assertAlmostEqual(res.spin[0].csa, N15_CSA)
89 90
91 - def test_consistency(self):
92 """Test a complete consistency tests run using a script.""" 93 94 # Execute the script. 95 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests.py')
96