Author: bugman Date: Wed Mar 26 17:49:22 2014 New Revision: 22538 URL: http://svn.gna.org/viewcvs/relax?rev=22538&view=rev Log: Merged revisions 22537 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r22537 | bugman | 2014-03-26 17:43:37 +0100 (Wed, 26 Mar 2014) | 5 lines Modified the Noe.test_noe_analysis system test to catch bug #21863 (https://gna.org/bugs/?21863). This is the failure to create the ref and sat Grace 2D plots in the NOE analysis. ........ Modified: branches/double_rotor/ (props changed) branches/double_rotor/test_suite/system_tests/noe.py branches/double_rotor/test_suite/system_tests/scripts/noe/noe.py Propchange: branches/double_rotor/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Mar 26 17:49:22 2014 @@ -1 +1 @@ -/trunk:1-22535 +/trunk:1-22537 Modified: branches/double_rotor/test_suite/system_tests/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/system_tests/noe.py?rev=22538&r1=22537&r2=22538&view=diff ============================================================================== --- branches/double_rotor/test_suite/system_tests/noe.py (original) +++ branches/double_rotor/test_suite/system_tests/noe.py Wed Mar 26 17:49:22 2014 @@ -20,8 +20,8 @@ ############################################################################### # Python module imports. -from os import sep -from tempfile import mktemp +from os import F_OK, access, sep +from tempfile import mkdtemp, mktemp # relax module imports. from data_store import Relax_data_store; ds = Relax_data_store() @@ -41,6 +41,10 @@ # Create a temporary file. ds.tmpfile = mktemp() + + # Create a temporary directory for dumping files. + ds.tmpdir = mkdtemp() + self.tmpdir = ds.tmpdir def test_bug_21562_noe_replicate_fail(self): @@ -134,7 +138,10 @@ def test_noe_analysis(self): - """Test the NOE analysis.""" + """Test the NOE analysis. + + The test has been modified to also catch U{bug #21863<https://gna.org/bugs/?21863>}. + """ # Execute the script. self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'noe'+sep+'noe.py') @@ -164,7 +171,7 @@ i += 1 # The real Grace file data. - data = [ + data = [[], [], [ '@version 50121\n', '@page size 842, 595\n', '@with g0\n', @@ -215,13 +222,28 @@ '&\n', '@with g0\n', '@autoscale\n' - ] - - # Check the Grace file. - file = open(ds.tmpfile) - lines = file.readlines() - file.close() - for i in range(len(lines)): - print(" '%s\\n'," % lines[i][:-1].replace('"', "\\\"")) - for i in range(len(lines)): - self.assertEqual(data[i], lines[i]) + ]] + + # Check the Grace files. + ids = ['ref', 'sat', 'noe'] + for i in range(len(ids)): + # The file name. + file_name = "%s.agr" % ids[i] + print file_name + + # Does the file exist? + self.assert_(access(ds.tmpdir+sep+file_name, F_OK)) + + # Open the file and extract the contents. + file = open(ds.tmpdir + sep + file_name) + lines = file.readlines() + file.close() + + # Nothing. + self.assertNotEqual(lines, []) + + # Check the file contents. + for j in range(len(lines)): + print(" '%s\\n'," % lines[j][:-1].replace('"', "\\\"")) + for j in range(len(lines)): + self.assertEqual(data[i][j], lines[j]) Modified: branches/double_rotor/test_suite/system_tests/scripts/noe/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/system_tests/scripts/noe/noe.py?rev=22538&r1=22537&r2=22538&view=diff ============================================================================== --- branches/double_rotor/test_suite/system_tests/scripts/noe/noe.py (original) +++ branches/double_rotor/test_suite/system_tests/scripts/noe/noe.py Wed Mar 26 17:49:22 2014 @@ -47,9 +47,9 @@ value.write(param='noe', file='devnull', force=True) # Create grace files. -grace.write(y_data_type='ref', file='devnull', force=True) -grace.write(y_data_type='sat', file='devnull', force=True) -grace.write(y_data_type='noe', file=ds.tmpfile, dir=None, force=True) +grace.write(y_data_type='ref', file='ref.agr', dir=ds.tmpdir, force=True) +grace.write(y_data_type='sat', file='sat.agr', dir=ds.tmpdir, force=True) +grace.write(y_data_type='noe', file='noe.agr', dir=ds.tmpdir, force=True) # Write the results. results.write(file='devnull', dir=None, force=True)