Author: bugman Date: Mon Dec 2 10:48:35 2013 New Revision: 21734 URL: http://svn.gna.org/viewcvs/relax?rev=21734&view=rev Log: Improved the checking of the Structure.test_read_gaussian_strychnine system test. This now checks all the atomic information loaded. Modified: trunk/test_suite/system_tests/structure.py Modified: trunk/test_suite/system_tests/structure.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=21734&r1=21733&r2=21734&view=diff ============================================================================== --- trunk/test_suite/system_tests/structure.py (original) +++ trunk/test_suite/system_tests/structure.py Mon Dec 2 10:48:35 2013 @@ -27,7 +27,7 @@ # relax module imports. from data_store import Relax_data_store; ds = Relax_data_store() -from pipe_control.mol_res_spin import count_spins, return_spin +from pipe_control.mol_res_spin import count_spins, return_spin, spin_loop from lib.geometry.rotations import euler_to_R_zyz from lib.errors import RelaxError from lib.io import DummyFileObject @@ -365,6 +365,70 @@ # And now all the rest of the atoms. self.interpreter.structure.load_spins() + + # The actual data. + data = [ + [ 5, 'C', -0.258837, -2.073956, -0.558021], + [ 6, 'C', -0.824223, -1.406962, -1.808433], + [ 7, 'C', -1.741283, -0.250780, -1.378644], + [ 8, 'C', -0.819735, 0.828965, -0.783392], + [ 9, 'C', 0.003153, 0.334416, 0.415455], + [10, 'C', 2.358372, 0.448322, 0.162421], + [11, 'C', 3.667689, 0.888405, -0.010558], + [12, 'C', 4.632616, -0.056196, -0.360560], + [13, 'C', 4.303015, -1.398582, -0.525823], + [14, 'C', 2.988069, -1.825141, -0.331972], + [15, 'C', 2.015427, -0.899636, 0.012625], + [16, 'C', 0.561728, -1.122705, 0.360284], + [17, 'C', 0.390886, -1.834862, 1.723978], + [18, 'C', -1.067936, -2.282629, 1.709808], + [19, 'C', -2.708975, -2.252045, -0.131301], + [20, 'C', -2.815469, -0.775379, -0.431910], + [21, 'C', -3.718174, 0.023460, 0.134879], + [22, 'C', -3.726395, 1.516213, -0.058936], + [23, 'C', -1.423939, 2.193179, -0.407936], + [24, 'C', -0.372897, 3.059448, 0.332496], + [25, 'C', 1.064718, 2.558120, 0.325331], + [26, 'H', 0.399932, -2.896344, -0.855386], + [27, 'H', -1.364146, -2.140645, -2.409934], + [28, 'H', -0.007016, -1.035292, -2.430851], + [29, 'H', -2.229948, 0.177326, -2.261725], + [30, 'H', -0.101863, 1.055799, -1.581061], + [31, 'H', -0.582210, 0.470722, 1.326014], + [32, 'H', 3.918694, 1.929549, 0.116264], + [33, 'H', 5.656588, 0.267474, -0.505165], + [34, 'H', 5.068478, -2.115052, -0.797816], + [35, 'H', 2.736463, -2.873299, -0.445917], + [36, 'H', 1.059165, -2.698455, 1.760657], + [37, 'H', 0.631843, -1.189746, 2.570301], + [38, 'H', -1.243126, -3.142405, 2.361743], + [39, 'H', -1.719677, -1.470258, 2.058429], + [40, 'H', -3.410692, -2.541912, 0.651788], + [41, 'H', -2.971493, -2.840572, -1.016009], + [42, 'H', -4.455619, -0.395106, 0.813636], + [43, 'H', -3.834304, 1.785629, -1.118252], + [44, 'H', -4.559845, 1.966160, 0.480526], + [45, 'H', -1.736135, 2.699031, -1.329897], + [46, 'H', -0.354638, 4.078330, -0.048526], + [47, 'H', -0.690723, 3.116119, 1.378208], + [ 1, 'O', -2.547545, 2.139059, 0.472310], + [ 2, 'O', 2.015408, 3.324289, 0.213156], + [ 3, 'N', 1.207610, 1.203922, 0.478894], + [ 4, 'N', -1.350394, -2.624460, 0.301178] + ] + + # Check the data. + i = 0 + for spin in spin_loop(): + self.assertEqual(spin.num, data[i][0]) + self.assertEqual(spin.name, data[i][1]) + self.assertEqual(spin.element, data[i][1]) + self.assertEqual(spin.pos[0], data[i][2]) + self.assertEqual(spin.pos[1], data[i][3]) + self.assertEqual(spin.pos[2], data[i][4]) + + # Increment the spin index. + i += 1 def test_read_merge(self):