1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 from os import sep
24
25
26 from data_store import Relax_data_store; ds = Relax_data_store()
27 from status import Status; status = Status()
28 from test_suite.system_tests.base_classes import SystemTestCase
29
30
32 """TestCase class for the loading of spins into the molecule/residue/spin data structure."""
33
39
40
42 """Test the loading of spins from a small molecule."""
43
44
45 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'load_spins_from_small_molecule.py')
46
47
48 self.assertEqual(len(cdp.mol), 1)
49 self.assertEqual(cdp.mol[0].name, 'gromacs_mol1')
50 self.assertEqual(len(cdp.mol[0].res), 1)
51 self.assertEqual(cdp.mol[0].res[0].num, 1)
52 self.assertEqual(cdp.mol[0].res[0].name, 'PYR')
53
54
55 nums = [4, 6, 8, 10, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 15, 16, 28, 30]
56 names = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7', 'H8', 'H9', 'H10', 'H11', 'H12', 'H13', 'H14', 'H15', 'H16', 'H17', 'H18', 'H19', 'H20', 'H21', 'H22', 'H23', 'H24', 'H25', 'H26', 'H27', 'H28', 'C5', 'C6', 'C19', 'C23']
57 elements = ['H']*28 + ['C']*4
58
59
60 self.assertEqual(len(cdp.mol[0].res[0].spin), 32)
61 for i in range(len(cdp.mol[0].res[0].spin)):
62 self.assertEqual(cdp.mol[0].res[0].spin[i].num, nums[i])
63 self.assertEqual(cdp.mol[0].res[0].spin[i].name, names[i])
64 self.assertEqual(cdp.mol[0].res[0].spin[i].element, elements[i])
65 self.assert_(hasattr(cdp.mol[0].res[0].spin[i], 'pos'))
66