1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16   
17   
18   
19   
20   
21   
22   
23   
24  from os import sep 
25   
26   
27  from base_classes import SystemTestCase 
28  from data import Relax_data_store; ds = Relax_data_store() 
29  from status import Status; status = Status() 
30   
31   
33      """Class for testing the angle calculation function.""" 
34   
36          """The user function angles().""" 
37   
38           
39          self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'angles.py') 
40   
41           
42          res_name = ['GLY', 'PRO', 'LEU', 'GLY', 'SER', 'MET', 'ASP', 'SER', 'PRO', 'PRO', 'GLU', 'GLY'] 
43          spin_num = [1, 11, 28, 51, 59, 71, 91, 104, 116, 133, 150, 167] 
44          spin_name = ['N']*12 
45          attached_atoms = [None, None, 'H', 'H', 'H', 'H', 'H', 'H', None, None, 'H', 'H'] 
46          xh_vects = [ 
47              None, 
48              None, 
49              [0.408991870425, -0.805744582632, 0.428370537602], 
50              [-0.114123686687, -0.989411605119, -0.0896686109685], 
51              [-0.0162975723187, -0.975817142584, 0.217980029763], 
52              [-0.255934111969, -0.960517663248, -0.109103386377], 
53              [0.922628022844, 0.38092966093, 0.0604162634271], 
54              [0.926402811426, 0.281593806116, 0.249965516299], 
55              None, 
56              None, 
57              [0.820296708196, 0.570330671495, -0.0428513205774], 
58              [-0.223383112106, -0.034680483158, -0.974113571055] 
59          ] 
60          alpha = [None, None, 2.8102691247870459, 2.6063738282640672, 2.9263088853837358, 2.5181004004450211, 1.3361463581932049, 1.5031623128368377, None, None, 1.0968465542222101, 1.1932423104331247] 
61   
62           
63          self.assertEqual(len(cdp.mol), 1) 
64          self.assertEqual(cdp.mol[0].name, 'Ap4Aase_res1-12_mol1') 
65          self.assertEqual(len(cdp.mol[0].res), 12) 
66   
67           
68          for i in xrange(12): 
69              print((cdp.mol[0].res[i].spin[0])) 
70               
71              self.assertEqual(cdp.mol[0].res[i].num, i+1) 
72              self.assertEqual(cdp.mol[0].res[i].name, res_name[i]) 
73              self.assertEqual(len(cdp.mol[0].res[i].spin), 1) 
74              self.assertEqual(cdp.mol[0].res[i].spin[0].num, spin_num[i]) 
75              self.assertEqual(cdp.mol[0].res[i].spin[0].name, spin_name[i]) 
76   
77               
78              if hasattr(cdp.mol[0].res[i].spin[0], 'attached_atom'): 
79                   
80                  self.assertEqual(cdp.mol[0].res[i].spin[0].attached_atom, attached_atoms[i]) 
81   
82                   
83                  for j in xrange(3): 
84                      self.assertAlmostEqual(cdp.mol[0].res[i].spin[0].xh_vect[j], xh_vects[i][j]) 
85   
86                   
87                  self.assertAlmostEqual(cdp.mol[0].res[i].spin[0].alpha, alpha[i]) 
88   
89               
90              else: 
91                  self.assertEqual(attached_atoms[i], None) 
92                  self.assert_(not hasattr(cdp.mol[0].res[i].spin[0], 'xh_vect')) 
93                  self.assert_(not hasattr(cdp.mol[0].res[i].spin[0], 'alpha')) 
  94