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  #                                                                             # 
 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 copy import deepcopy 
24   
25  # relax module imports. 
26  from lib.dispersion.variables import MODEL_CR72, MODEL_MMQ_CR72, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_R1RHO_3SITE 
27  from lib.dispersion.variables import MODEL_EXP_TYPE, MODEL_EQ, MODEL_PARAMS, MODEL_SITES, MODEL_YEAR 
28  from test_suite.unit_tests.base_classes import UnitTestCase 
29   
30   
31 -class Test_variables(UnitTestCase):
32 """Unit tests for the functions of the lib.dispersion.variables module.""" 33 34
35 - def test_MODEL_PARAMS(self):
36 """Unit test of the MODEL_PARAM dictionary.""" 37 38 # Test parameter return from model parameter dictionary. 39 params_cr72 = deepcopy(MODEL_PARAMS[MODEL_CR72]) 40 41 # Test the return. 42 self.assertEqual(params_cr72, ['r2', 'pA', 'dw', 'kex'])
43 44
45 - def test_MODEL_YEAR(self):
46 """Unit test of the MODEL_YEAR dictionary.""" 47 48 # Test model year return from model year dictionary. 49 year_cr72 = MODEL_YEAR[MODEL_CR72] 50 51 # Test the return. 52 self.assertEqual(year_cr72, 1972)
53 54
55 - def test_MODEL_EXP_TYPE(self):
56 """Unit test of the MODEL_EXP_TYPE dictionary.""" 57 58 # Test model year return from model year dictionary. 59 exp_type_mmq_cr72 = MODEL_EXP_TYPE[MODEL_MMQ_CR72] 60 61 # Test the return. 62 self.assertEqual(exp_type_mmq_cr72, 'CPMG: SQ, DQ, MQ, ZQ, 1H SQ, 1H MQ')
63 64
65 - def test_MODEL_SITES(self):
66 """Unit test of the MODEL_SITES dictionary.""" 67 68 # Test model chemical sites return from model sites dictionary. 69 model_sites = MODEL_SITES[MODEL_NS_R1RHO_3SITE] 70 71 # Test the return. 72 self.assertEqual(model_sites, 3)
73 74
75 - def test_MODEL_EQ(self):
76 """Unit test of the MODEL_EQ dictionary.""" 77 78 # Test model equation type return from model equation dictionary. 79 model_eq = MODEL_EQ[MODEL_NS_CPMG_2SITE_EXPANDED] 80 81 # Test the return. 82 self.assertEqual(model_eq, 'silico')
83