1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16   
17   
18   
19   
20   
21   
22   
23   
24   
25  from os import sep 
26   
27   
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   
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           
50          self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'bug_20674_ct_analysis_failure.py') 
 51   
52   
54          """The consistency testing calculation test.""" 
55   
56           
57          self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests_calc_test.py') 
58   
59           
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           
65          index = 0 
66          for res in residue_loop(): 
67               
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               
76              else: 
77                  self.assert_(not res.spin[0].select) 
 78   
79   
81          """The user function value.set().""" 
82   
83           
84          self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests_set_value.py') 
85   
86           
87          for res in residue_loop(): 
88              self.assertAlmostEqual(res.spin[0].csa, N15_CSA) 
 89   
90   
92          """Test a complete consistency tests run using a script.""" 
93   
94           
95          self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'consistency_tests.py') 
  96