Package test_suite :: Package unit_tests :: Package _specific_analyses :: Package _relax_disp :: Module test_variables
[hide private]
[frames] | no frames]

Source Code for Module test_suite.unit_tests._specific_analyses._relax_disp.test_variables

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2014 Troels E. Linnet                                         # 
 4  # Copyright (C) 2014 Edward d'Auvergne                                        # 
 5  #                                                                             # 
 6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 7  #                                                                             # 
 8  # This program is free software: you can redistribute it and/or modify        # 
 9  # it under the terms of the GNU General Public License as published by        # 
10  # the Free Software Foundation, either version 3 of the License, or           # 
11  # (at your option) any later version.                                         # 
12  #                                                                             # 
13  # This program is distributed in the hope that it will be useful,             # 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
16  # GNU General Public License for more details.                                # 
17  #                                                                             # 
18  # You should have received a copy of the GNU General Public License           # 
19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # relax module imports. 
24  from lib.dispersion.variables import MODEL_CR72, MODEL_MMQ_CR72, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_R1RHO_3SITE 
25  from lib.dispersion.variables import MODEL_EXP_TYPE, MODEL_EQ, MODEL_PARAMS, MODEL_SITES, MODEL_YEAR 
26  from test_suite.unit_tests.base_classes import UnitTestCase 
27   
28   
29 -class Test_variables(UnitTestCase):
30 """Unit tests for the functions of the lib.dispersion.variables module.""" 31 32
33 - def test_MODEL_PARAMS(self):
34 """Unit test of the MODEL_PARAM dictionary.""" 35 36 # Test parameter return from model parameter dictionary. 37 params_cr72 = MODEL_PARAMS[MODEL_CR72] 38 39 # Test the return. 40 self.assertEqual(params_cr72, ['r2', 'pA', 'dw', 'kex'])
41 42
43 - def test_MODEL_YEAR(self):
44 """Unit test of the MODEL_YEAR dictionary.""" 45 46 # Test model year return from model year dictionary. 47 year_cr72 = MODEL_YEAR[MODEL_CR72] 48 49 # Test the return. 50 self.assertEqual(year_cr72, 1972)
51 52
53 - def test_MODEL_EXP_TYPE(self):
54 """Unit test of the MODEL_EXP_TYPE dictionary.""" 55 56 # Test model year return from model year dictionary. 57 exp_type_mmq_cr72 = MODEL_EXP_TYPE[MODEL_MMQ_CR72] 58 59 # Test the return. 60 self.assertEqual(exp_type_mmq_cr72, 'CPMG: SQ, DQ, MQ, ZQ, 1H SQ, 1H MQ')
61 62
63 - def test_MODEL_SITES(self):
64 """Unit test of the MODEL_SITES dictionary.""" 65 66 # Test model chemical sites return from model sites dictionary. 67 model_sites = MODEL_SITES[MODEL_NS_R1RHO_3SITE] 68 69 # Test the return. 70 self.assertEqual(model_sites, 3)
71 72
73 - def test_MODEL_EQ(self):
74 """Unit test of the MODEL_EQ dictionary.""" 75 76 # Test model equation type return from model equation dictionary. 77 model_eq = MODEL_EQ[MODEL_NS_CPMG_2SITE_EXPANDED] 78 79 # Test the return. 80 self.assertEqual(model_eq, 'silico')
81