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-2012 Edward d'Auvergne                                   # 
 6  #                                                                             # 
 7  # This file is part of the program relax.                                     # 
 8  #                                                                             # 
 9  # relax 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 2 of the License, or           # 
12  # (at your option) any later version.                                         # 
13  #                                                                             # 
14  # relax 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 relax; if not, write to the Free Software                        # 
21  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
22  #                                                                             # 
23  ############################################################################### 
24   
25  # Python module imports. 
26  from os import sep 
27  import sys 
28   
29  # relax module imports. 
30  from base_classes import SystemTestCase 
31  from data import Relax_data_store; ds = Relax_data_store() 
32  from generic_fns.mol_res_spin import residue_loop 
33  from physical_constants import N15_CSA, NH_BOND_LENGTH 
34  from status import Status; status = Status() 
35   
36   
37 -class Ct(SystemTestCase):
38 """Class for testing various aspects specific to consistency testing.""" 39 40
41 - def setUp(self):
42 """Set up for all the functional tests.""" 43 44 # Create the data pipe. 45 self.interpreter.pipe.create('ct', 'ct')
46 47
48 - def test_calc(self):
49 """The consistency testing calculation test.""" 50 51 # Execute the script. 52 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests_calc_test.py') 53 54 # Correct consistency functions values. 55 j0 = [4.0703318681008998e-09, 3.7739393907014834e-09] 56 f_eta = [0.20413244790407614, 0.18898977395296815] 57 f_r2 = [2.0482909381655862e-09, 1.8998154021753067e-09] 58 59 # Loop over residues. 60 index = 0 61 for res in residue_loop(): 62 # Residues -2 and -1 have data. 63 if res.num == -2 or res.num == -1: 64 self.assert_(res.spin[0].select) 65 self.assertAlmostEqual(res.spin[0].j0, j0[index]) 66 self.assertAlmostEqual(res.spin[0].f_eta, f_eta[index]) 67 self.assertAlmostEqual(res.spin[0].f_r2, f_r2[index]) 68 index = index + 1 69 70 # Other residues have insufficient data. 71 else: 72 self.assert_(not res.spin[0].select)
73 74
75 - def test_set_value(self):
76 """The user function value.set().""" 77 78 # Execute the script. 79 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests_set_value.py') 80 81 # Loop over residues. 82 for res in residue_loop(): 83 self.assertAlmostEqual(res.spin[0].r, NH_BOND_LENGTH) 84 self.assertAlmostEqual(res.spin[0].csa, N15_CSA)
85 86
87 - def test_consistency(self):
88 """Test a complete consistency tests run using a script.""" 89 90 # Execute the script. 91 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests.py')
92