mailr6521 - /1.3/test_suite/system_tests/model_free.py


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

Header


Content

Posted by edward on June 28, 2008 - 18:56:
Author: bugman
Date: Sat Jun 28 18:56:45 2008
New Revision: 6521

URL: http://svn.gna.org/viewcvs/relax?rev=6521&view=rev
Log:
Modified the test_write_results() system test for cross-platform support.


Modified:
    1.3/test_suite/system_tests/model_free.py

Modified: 1.3/test_suite/system_tests/model_free.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/model_free.py?rev=6521&r1=6520&r2=6521&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/model_free.py (original)
+++ 1.3/test_suite/system_tests/model_free.py Sat Jun 28 18:56:45 2008
@@ -925,23 +925,35 @@
         self.relax.interpreter._Results.write(file=file, dir=path)
 
         # Now, get the contents of that file, and then 'close' that file.
-        lines_test = file.readlines()
+        test_lines = file.readlines()
         file.close()
 
         # Read the 1.3 results file, extract the data, then close it again.
         file = open_read_file(file_name='final_results_trunc_1.3', dir=path)
-        lines_true = file.readlines()
+        true_lines = file.readlines()
         file.close()
 
         # Test the rest of the lines.
-        for i in xrange(len(lines_test)):
+        for i in xrange(len(test_lines)):
             # Skip the second line, as it contains the date and hence should 
not be the same.
             # Also skip the third line, as the pipe names are different.
             if i == 1 or i == 2:
                 continue
 
+            # Try to convert the test line into a python object (for 
cross-platform support).
+            try:
+                test_line = eval(test_lines[i])
+            except:
+                test_line = test_lines[i]
+
+            # Try to convert the true line into a python object (for 
cross-platform support).
+            try:
+                true_line = eval(true_lines[i])
+            except:
+                true_line = true_lines[i]
+
             # Test that the line is the same.
-            self.assertEqual(lines_test[i], lines_true[i])
+            self.assertEqual(test_line, true_line)
 
 
     def value_test(self, spin, select, s2, te, rex, chi2, iter, f_count, 
g_count, h_count, warning):




Related Messages


Powered by MHonArc, Updated Sat Jun 28 19:40:19 2008