mailr25038 - /trunk/test_suite/system_tests/relax_disp.py


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

Header


Content

Posted by tlinnet on August 15, 2014 - 20:30:
Author: tlinnet
Date: Fri Aug 15 20:30:44 2014
New Revision: 25038

URL: http://svn.gna.org/viewcvs/relax?rev=25038&view=rev
Log:
Added to systemtest a count of number of headers and values, when issuing a 
value.write().

sr #3121(https://gna.org/support/?3121): Support request for replacing space 
in header files for the value.write functions.

Modified:
    trunk/test_suite/system_tests/relax_disp.py

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=25038&r1=25037&r2=25038&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Fri Aug 15 20:30:44 2014
@@ -1264,6 +1264,61 @@
 
         # Perform write.
         self.interpreter.grace.write(x_data_type='res_num', 
y_data_type=param, file='%s.agr'%param, dir=self.tmpdir, force=True)
+
+
+        # Test the header of the value.write  parameter r2.
+        param = 'r2'
+        self.interpreter.value.write(param=param, file='%s.out'%param, 
dir=self.tmpdir, force=True)
+
+        file = open(self.tmpdir+sep+'%s.out'%param)
+        lines = file.readlines()
+        file.close()
+
+        for i, line in enumerate(lines):
+            # Make the string test
+            line_split = line.split()
+            print(line_split)
+
+            if len(line_split) > 1:
+                # Break at parameter header.
+                if line_split[0] == "#" and line_split[1] == 'mol_name':
+                    nr_split_header = len(line_split)
+                    nr_split_header_i = i
+                    break
+
+        # Call the line after.
+        line_split_val = lines[nr_split_header_i + 1].split()
+        print(line_split_val)
+
+        # Assert that the number of columns is equal, plus 1 for "#".
+        self.assertEqual(nr_split_header, len(line_split_val) + 1)
+
+        # Test the header of the value.write for parameter r2eff.
+        param = 'r2eff'
+        self.interpreter.value.write(param=param, file='%s.out'%param, 
dir=self.tmpdir, force=True)
+
+        file = open(self.tmpdir+sep+'%s.out'%param)
+        lines = file.readlines()
+        file.close()
+
+        for i, line in enumerate(lines):
+            # Make the string test
+            line_split = line.split()
+            print(line_split)
+
+            if len(line_split) > 1:
+                # Break at parameter header.
+                if line_split[0] == "#" and line_split[1] == 'mol_name':
+                    nr_split_header = len(line_split)
+                    nr_split_header_i = i
+                    break
+
+        # Call the line after.
+        line_split_val = lines[nr_split_header_i + 1].split()
+        print(line_split_val)
+
+        # Assert that the number of columns is equal, plus 1 for "#".
+        self.assertEqual(nr_split_header, len(line_split_val) + 1)
 
 
     def test_cpmg_synthetic_b14_to_ns3d_cluster(self):




Related Messages


Powered by MHonArc, Updated Fri Aug 15 20:40:02 2014