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

Source Code for Module test_suite.system_tests.generic

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2006-2013 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 6  #                                                                             # 
 7  # This program is free software: you can redistribute it and/or modify        # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation, either version 3 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # This program is distributed in the hope that it will be useful,             # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
19  #                                                                             # 
20  ############################################################################### 
21   
22  # Python module imports. 
23  from os import sep 
24   
25  # relax module imports. 
26  from data_store import Relax_data_store; ds = Relax_data_store() 
27  from pipe_control import pipes 
28  from status import Status; status = Status() 
29  from test_suite.system_tests.base_classes import SystemTestCase 
30   
31   
32 -class Generic(SystemTestCase):
33 """Class containing generic tests of relax execution.""" 34
35 - def test_nested_scripting(self):
36 """Test nested scripting.""" 37 38 # Execute the script. 39 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'nested_scripting'+sep+'main.py') 40 41 # Check. 42 self.assertEqual(cdp.nest, ['a', 'b', 'c', 'd'])
43 44
45 - def test_value_diff(self):
46 """S2 difference stored in a new data pipe.""" 47 48 # Init. 49 pipe_list = ['orig1', 'orig2', 'new'] 50 s2 = [0.9, 0.7, None] 51 52 # Loop over the data pipes to create and fill. 53 for i in range(3): 54 # Create the data pipe. 55 self.interpreter.pipe.create(pipe_list[i], 'mf') 56 57 # Load the Lupin Ap4Aase sequence. 58 self.interpreter.sequence.read(file="Ap4Aase.seq", dir=status.install_path + sep+'test_suite'+sep+'shared_data', res_num_col=1, res_name_col=2) 59 60 # Only select residue 8. 61 self.interpreter.select.spin(spin_id=':8', change_all=True) 62 63 # Set the order parameter value. 64 if s2[i]: 65 self.interpreter.value.set(s2[i], 's2', spin_id=':8') 66 67 # Get the data pipes. 68 dp_orig1 = pipes.get_pipe('orig1') 69 dp_orig2 = pipes.get_pipe('orig2') 70 dp_new = pipes.get_pipe('new') 71 72 # Calculate the difference and assign it to residue 8 (located in position 7). 73 diff = dp_orig1.mol[0].res[7].spin[0].s2 - dp_orig2.mol[0].res[7].spin[0].s2 74 self.interpreter.value.set(diff, 's2', spin_id=':8') 75 76 # Test if the difference is 0.2! 77 self.assertAlmostEqual(dp_new.mol[0].res[7].spin[0].s2, 0.2)
78 79
81 """Test the creation of a PDB representation of the distribution of XH bond vectors.""" 82 83 # Execute the script. 84 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'xh_vector_dist.py')
85