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-2012 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax.                                     # 
 6  #                                                                             # 
 7  # relax 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 2 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # relax 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 relax; if not, write to the Free Software                        # 
19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # Python module imports. 
24  from os import sep 
25  import sys 
26   
27  # relax module imports. 
28  from base_classes import SystemTestCase 
29  from data import Relax_data_store; ds = Relax_data_store() 
30  from generic_fns import pipes 
31  from status import Status; status = Status() 
32   
33   
34 -class Generic(SystemTestCase):
35 """Class containing generic tests of relax execution.""" 36
37 - def test_nested_scripting(self):
38 """Test nested scripting.""" 39 40 # Execute the script. 41 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'nested_scripting'+sep+'main.py') 42 43 # Check. 44 self.assertEqual(cdp.nest, ['a', 'b', 'c', 'd'])
45 46
47 - def test_value_diff(self):
48 """S2 difference stored in a new data pipe.""" 49 50 # Init. 51 pipe_list = ['orig1', 'orig2', 'new'] 52 s2 = [0.9, 0.7, None] 53 54 # Loop over the data pipes to create and fill. 55 for i in xrange(3): 56 # Create the data pipe. 57 self.interpreter.pipe.create(pipe_list[i], 'mf') 58 59 # Load the Lupin Ap4Aase sequence. 60 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) 61 62 # Only select residue 8. 63 self.interpreter.select.spin(spin_id=':8', change_all=True) 64 65 # Set the order parameter value. 66 if s2[i]: 67 self.interpreter.value.set(s2[i], 's2', spin_id=':8') 68 69 # Get the data pipes. 70 dp_orig1 = pipes.get_pipe('orig1') 71 dp_orig2 = pipes.get_pipe('orig2') 72 dp_new = pipes.get_pipe('new') 73 74 # Calculate the difference and assign it to residue 8 (located in position 7). 75 diff = dp_orig1.mol[0].res[7].spin[0].s2 - dp_orig2.mol[0].res[7].spin[0].s2 76 self.interpreter.value.set(diff, 's2', spin_id=':8') 77 78 # Test if the difference is 0.2! 79 self.assertAlmostEqual(dp_new.mol[0].res[7].spin[0].s2, 0.2)
80 81
83 """Test the creation of a PDB representation of the distribution of XH bond vectors.""" 84 85 # Execute the script. 86 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'xh_vector_dist.py')
87