Author: bugman Date: Wed Oct 5 18:54:14 2011 New Revision: 14795 URL: http://svn.gna.org/viewcvs/relax?rev=14795&view=rev Log: Created the Relax_fit.test_bug_18789() system test for catching bug #18789. The Grace file is written out, re-opened, and then the numbers checked. Modified: 1.3/test_suite/system_tests/relax_fit.py Modified: 1.3/test_suite/system_tests/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/relax_fit.py?rev=14795&r1=14794&r2=14795&view=diff ============================================================================== --- 1.3/test_suite/system_tests/relax_fit.py (original) +++ 1.3/test_suite/system_tests/relax_fit.py Wed Oct 5 18:54:14 2011 @@ -114,6 +114,32 @@ self.assertEqual(lines[index][1], '487178.0') + def test_bug_18789(self): + """Test for zero errors in Grace plots, replicating bug #18789.""" + + # Execute the script. + self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'curve_fitting'+sep+'bug_18789_no_grace_errors.py') + + # Open the Grace file. + file = open(ds.tmpdir + sep + 'rx.agr') + lines = file.readlines() + file.close() + + # Loop over all lines. + for i in xrange(len(lines)): + # Find the "@target G0.S0" line. + if search('@target', lines[i]): + index = i + 2 + + # Split up the lines. + lines[i] = split(lines[i]) + + # Check for zero errors. + self.assertEqual(len(lines[index]), 3) + self.assertNotEqual(lines[index][2], '0.0') + self.assertNotEqual(lines[index+1][2], '0.0') + + def test_curve_fitting_height(self): """Test the relaxation curve fitting C modules."""