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

Source Code for Module test_suite.system_tests.jw_mapping

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2006 Chris MacRaild                                           # 
 4  # Copyright (C) 2007-2012 Edward d'Auvergne                                   # 
 5  #                                                                             # 
 6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 7  #                                                                             # 
 8  # This program is free software: you can redistribute it and/or modify        # 
 9  # it under the terms of the GNU General Public License as published by        # 
10  # the Free Software Foundation, either version 3 of the License, or           # 
11  # (at your option) any later version.                                         # 
12  #                                                                             # 
13  # This program is distributed in the hope that it will be useful,             # 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
16  # GNU General Public License for more details.                                # 
17  #                                                                             # 
18  # You should have received a copy of the GNU General Public License           # 
19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # Python module imports. 
24  from os import sep 
25  import sys 
26   
27  # relax module imports. 
28  from data import Relax_data_store; ds = Relax_data_store() 
29  from generic_fns.mol_res_spin import residue_loop 
30  from physical_constants import N15_CSA, NH_BOND_LENGTH 
31  from status import Status; status = Status() 
32  from test_suite.system_tests.base_classes import SystemTestCase 
33   
34   
35 -class Jw(SystemTestCase):
36 """Class for testing various aspects specific to reduced spectral density mapping.""" 37
38 - def setUp(self):
39 """Set up for all the functional tests.""" 40 41 # Create the data pipe. 42 self.interpreter.pipe.create('jw', 'jw')
43 44
45 - def test_calc(self):
46 """The spectral density calculation test.""" 47 48 # Execute the script. 49 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping_calc_test.py') 50 51 # Correct jw values. 52 j0 = [4.0703318681008998e-09, 3.7739393907014834e-09] 53 jwx = [1.8456254300773903e-10, 1.6347516082378241e-10] 54 jwh = [1.5598167512718012e-12, 2.9480536599037041e-12] 55 56 # Loop over residues. 57 index = 0 58 for res in residue_loop(): 59 # Residues -2 and -1 have data. 60 if res.num == -2 or res.num == -1: 61 self.assert_(res.spin[0].select) 62 self.assertAlmostEqual(res.spin[0].j0, j0[index]) 63 self.assertAlmostEqual(res.spin[0].jwh, jwh[index]) 64 self.assertAlmostEqual(res.spin[0].jwx, jwx[index]) 65 index = index + 1 66 67 # Other residues have insufficient data. 68 else: 69 self.assert_(not res.spin[0].select)
70 71
72 - def test_set_value(self):
73 """The user function value.set().""" 74 75 # Execute the script. 76 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping_set_value.py') 77 78 # Loop over residues. 79 for res in residue_loop(): 80 self.assertAlmostEqual(res.spin[0].csa, N15_CSA)
81 82
83 - def test_mapping(self):
84 """Test a complete jw mapping run using a script.""" 85 86 # Execute the script. 87 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping.py')
88