Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2014 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 unittest import TestCase 24 25 # relax module imports. 26 from lib.periodic_table import periodic_table 27 2830 """Unit tests for the lib.periodic_table module.""" 31 328734 """Test of the periodic_table.atomic_mass() method.""" 35 36 # Check the proton weight. 37 weight = periodic_table.atomic_mass(id='H') 38 self.assertEqual(weight, 1.007975) 39 40 # Check the 1H weight. 41 weight = periodic_table.atomic_mass(id='1H') 42 self.assertEqual(weight, 1.0078250322) 43 44 # Check the 2H weight. 45 weight = periodic_table.atomic_mass(id='2H') 46 self.assertEqual(weight, 2.0141017781)47 4850 """Test of the periodic_table.atomic_weight() method.""" 51 52 # Check the proton weight. 53 weight = periodic_table.atomic_weight(symbol='H') 54 self.assertEqual(weight, 1.007975) 55 56 # Check the helium weight. 57 weight = periodic_table.atomic_weight(symbol='He') 58 self.assertEqual(weight, 4.002602)59 6062 """Test of the Periodic_table.has_element() method with the symbol 'C'.""" 63 64 # Check. 65 self.assertTrue(periodic_table.has_element('C'))66 6769 """Test of the Periodic_table.has_element() method with the symbol 'NI'.""" 70 71 # Check. 72 self.assertTrue(periodic_table.has_element('NI'))73 7476 """Test of the Periodic_table.has_element() method with the symbol 'Ni'.""" 77 78 # Check. 79 self.assertTrue(periodic_table.has_element('Ni'))80 8183 """Test of the Periodic_table.has_element() method with the symbol 'XYZ'.""" 84 85 # Check. 86 self.assertTrue(not periodic_table.has_element('XYZ'))
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 8 10:45:14 2024 | http://epydoc.sourceforge.net |