mailr10788 - /1.3/test_suite/system_tests/relax_fit.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 19, 2010 - 19:00:
Author: bugman
Date: Fri Feb 19 19:00:30 2010
New Revision: 10788

URL: http://svn.gna.org/viewcvs/relax?rev=10788&view=rev
Log:
Fix for the test_bug_12670_12679() system test.

The Grace file lines are now not hardcoded!!!


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=10788&r1=10787&r2=10788&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/relax_fit.py (original)
+++ 1.3/test_suite/system_tests/relax_fit.py Fri Feb 19 19:00:30 2010
@@ -22,6 +22,7 @@
 
 # Python module imports.
 from os import sep
+from re import search
 from shutil import rmtree
 from string import split
 import sys
@@ -69,14 +70,19 @@
         lines = file.readlines()
         file.close()
 
-        # Split up the lines.
+        # 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 some of the Grace data.
-        self.assertEqual(len(lines[23]), 2)
-        self.assertEqual(lines[23][0], '0.004')
-        self.assertEqual(lines[23][1], '487178.0')
+        self.assertEqual(len(lines[index]), 2)
+        self.assertEqual(lines[index][0], '0.004')
+        self.assertEqual(lines[index][1], '487178.0')
 
 
     def test_curve_fitting(self):




Related Messages


Powered by MHonArc, Updated Sun Feb 21 16:00:02 2010