Author: tlinnet Date: Tue Aug 19 18:43:02 2014 New Revision: 25086 URL: http://svn.gna.org/viewcvs/relax?rev=25086&view=rev Log: Added to systemtest Relax_disp.test_r1rho_kjaergaard_missing_r1 to check, that values are not None when writing .out files. This is related to: https://gna.org/support/index.php?3121 sr #3121: Support request for replacing space in header files for the value.write functions The fix for this bug, destroyed getting the values. 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=25086&r1=25085&r2=25086&view=diff ============================================================================== --- trunk/test_suite/system_tests/relax_disp.py (original) +++ trunk/test_suite/system_tests/relax_disp.py Tue Aug 19 18:43:02 2014 @@ -5378,7 +5378,8 @@ # Print the final pipe. - self.interpreter.pipe.switch(pipe_name='%s - relax_disp' % ('final')) + model = 'final' + self.interpreter.pipe.switch(pipe_name='%s - relax_disp' % (model)) print("\nFinal pipe") # Loop over the spins. @@ -5393,6 +5394,45 @@ # Get the value. value = getattr(cur_spin, param) print("%-10s %-6s %-6s %6s" % ("Parameter:", param, "Value:", value)) + + + ### Now check some of the written out files. + file_names = ['r1rho_prime', 'r1'] + + for file_name_i in file_names: + + # Make the file name. + file_name = "%s.out" % file_name_i + + # Get the file path. + file_path = get_file_path(file_name, result_dir_name + sep + model) + + # Test the file exists. + print("Testing file access to: %s"%file_path) + self.assert_(access(file_path, F_OK)) + + # Now open, and compare content, line by line. + file_prod = open(file_path) + lines_prod = file_prod.readlines() + file_prod.close() + + # Loop over the lines. + for i, line in enumerate(lines_prod): + # Make the string test + line_split = line.split() + + # Continue for comment lines. + if line_split[0] == "#": + print(line), + continue + + # Assign the split of the line. + mol_name, res_num, res_name, spin_num, spin_name, val, sd_error = line_split + print mol_name, res_num, res_name, spin_num, spin_name, val, sd_error + + if res_num == '52': + # Assert that the value is not None. + self.assertNotEqual(val, 'None') def test_r2eff_read(self):